diff options
author | Jeremy Allison <jra@samba.org> | 2009-04-09 22:46:59 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-04-09 22:46:59 -0700 |
commit | 7f10bf980edef3ace1522d0c9c082b35e225c950 (patch) | |
tree | d4e9af21de194cca812e754b28f9358a3651f4ce /source4/torture/rpc/ntsvcs.c | |
parent | f8f68703da58cf7f61b655b48bbbc45cda647748 (diff) | |
parent | f930f504e1d5e78d2f6f36cab9ce36dbeb34e955 (diff) | |
download | samba-7f10bf980edef3ace1522d0c9c082b35e225c950.tar.gz samba-7f10bf980edef3ace1522d0c9c082b35e225c950.tar.bz2 samba-7f10bf980edef3ace1522d0c9c082b35e225c950.zip |
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source4/torture/rpc/ntsvcs.c')
-rw-r--r-- | source4/torture/rpc/ntsvcs.c | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/source4/torture/rpc/ntsvcs.c b/source4/torture/rpc/ntsvcs.c index 5453102039..04494b3223 100644 --- a/source4/torture/rpc/ntsvcs.c +++ b/source4/torture/rpc/ntsvcs.c @@ -47,18 +47,26 @@ static bool test_PNP_GetVersion(struct torture_context *tctx, static bool test_PNP_GetDeviceListSize(struct torture_context *tctx, struct dcerpc_pipe *p) { - NTSTATUS status; struct PNP_GetDeviceListSize r; uint32_t size = 0; r.in.devicename = NULL; - r.in.flags = 0; + r.in.flags = CM_GETIDLIST_FILTER_SERVICE; r.out.size = &size; - status = dcerpc_PNP_GetDeviceListSize(p, tctx, &r); + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceListSize(p, tctx, &r), + "PNP_GetDeviceListSize"); + torture_assert_werr_equal(tctx, r.out.result, WERR_CM_INVALID_POINTER, + "PNP_GetDeviceListSize"); + + r.in.devicename = "Spooler"; - torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceListSize"); - torture_assert_werr_ok(tctx, r.out.result, "PNP_GetDeviceListSize"); + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceListSize(p, tctx, &r), + "PNP_GetDeviceListSize"); + torture_assert_werr_ok(tctx, r.out.result, + "PNP_GetDeviceListSize"); return true; } @@ -66,7 +74,6 @@ static bool test_PNP_GetDeviceListSize(struct torture_context *tctx, static bool test_PNP_GetDeviceList(struct torture_context *tctx, struct dcerpc_pipe *p) { - NTSTATUS status; struct PNP_GetDeviceList r; uint16_t *buffer = NULL; uint32_t length = 0; @@ -74,25 +81,35 @@ static bool test_PNP_GetDeviceList(struct torture_context *tctx, buffer = talloc_array(tctx, uint16_t, 0); r.in.filter = NULL; - r.in.flags = 0; + r.in.flags = CM_GETIDLIST_FILTER_SERVICE; r.in.length = &length; r.out.length = &length; r.out.buffer = buffer; - status = dcerpc_PNP_GetDeviceList(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceList"); + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceList(p, tctx, &r), + "PNP_GetDeviceList failed"); + torture_assert_werr_equal(tctx, r.out.result, WERR_CM_INVALID_POINTER, + "PNP_GetDeviceList failed"); + + r.in.filter = "Spooler"; + + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceList(p, tctx, &r), + "PNP_GetDeviceList failed"); if (W_ERROR_EQUAL(r.out.result, WERR_CM_BUFFER_SMALL)) { struct PNP_GetDeviceListSize s; - s.in.devicename = NULL; - s.in.flags = 0; + s.in.devicename = "Spooler"; + s.in.flags = CM_GETIDLIST_FILTER_SERVICE; s.out.size = &length; - status = dcerpc_PNP_GetDeviceListSize(p, tctx, &s); - - torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceListSize"); - torture_assert_werr_ok(tctx, s.out.result, "PNP_GetDeviceListSize"); + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceListSize(p, tctx, &s), + "PNP_GetDeviceListSize failed"); + torture_assert_werr_ok(tctx, s.out.result, + "PNP_GetDeviceListSize failed"); } buffer = talloc_array(tctx, uint16_t, length); @@ -101,9 +118,12 @@ static bool test_PNP_GetDeviceList(struct torture_context *tctx, r.out.length = &length; r.out.buffer = buffer; - status = dcerpc_PNP_GetDeviceList(p, tctx, &r); - torture_assert_ntstatus_ok(tctx, status, "PNP_GetDeviceList"); - torture_assert_werr_ok(tctx, r.out.result, "PNP_GetDeviceList"); + torture_assert_ntstatus_ok(tctx, + dcerpc_PNP_GetDeviceList(p, tctx, &r), + "PNP_GetDeviceList failed"); + + torture_assert_werr_ok(tctx, r.out.result, + "PNP_GetDeviceList failed"); return true; } |