mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
s4-srvsvc: merge srvsvc_NetDiskEnum from s3 idl.
Guenther
This commit is contained in:
@ -1168,9 +1168,9 @@ import "security.idl", "svcctl.idl";
|
|||||||
WERROR srvsvc_NetDiskEnum(
|
WERROR srvsvc_NetDiskEnum(
|
||||||
[in,unique] [string,charset(UTF16)] uint16 *server_unc,
|
[in,unique] [string,charset(UTF16)] uint16 *server_unc,
|
||||||
[in] uint32 level,
|
[in] uint32 level,
|
||||||
[in,out] srvsvc_NetDiskInfo info,
|
[in,out,ref] srvsvc_NetDiskInfo *info,
|
||||||
[in] uint32 maxlen,
|
[in] uint32 maxlen,
|
||||||
[out] uint32 totalentries,
|
[out,ref] uint32 *totalentries,
|
||||||
[in,out,unique] uint32 *resume_handle
|
[in,out,unique] uint32 *resume_handle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1558,27 +1558,26 @@ static WERROR dcesrv_srvsvc_NetSrvSetInfo(struct dcesrv_call_state *dce_call, TA
|
|||||||
static WERROR dcesrv_srvsvc_NetDiskEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
static WERROR dcesrv_srvsvc_NetDiskEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
||||||
struct srvsvc_NetDiskEnum *r)
|
struct srvsvc_NetDiskEnum *r)
|
||||||
{
|
{
|
||||||
r->out.info.disks = NULL;
|
r->out.info->disks = NULL;
|
||||||
r->out.info.count = 0;
|
r->out.info->count = 0;
|
||||||
r->out.totalentries = 0;
|
*r->out.totalentries = 0;
|
||||||
r->out.resume_handle = NULL;
|
|
||||||
|
|
||||||
switch (r->in.level) {
|
switch (r->in.level) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
/* we can safely hardcode the reply and report we have only one disk (C:) */
|
/* we can safely hardcode the reply and report we have only one disk (C:) */
|
||||||
/* for some reason Windows wants 2 entries with the second being empty */
|
/* for some reason Windows wants 2 entries with the second being empty */
|
||||||
r->out.info.disks = talloc_array(mem_ctx, struct srvsvc_NetDiskInfo0, 2);
|
r->out.info->disks = talloc_array(mem_ctx, struct srvsvc_NetDiskInfo0, 2);
|
||||||
W_ERROR_HAVE_NO_MEMORY(r->out.info.disks);
|
W_ERROR_HAVE_NO_MEMORY(r->out.info->disks);
|
||||||
r->out.info.count = 2;
|
r->out.info->count = 2;
|
||||||
|
|
||||||
r->out.info.disks[0].disk = talloc_strdup(mem_ctx, "C:");
|
r->out.info->disks[0].disk = talloc_strdup(mem_ctx, "C:");
|
||||||
W_ERROR_HAVE_NO_MEMORY(r->out.info.disks[0].disk);
|
W_ERROR_HAVE_NO_MEMORY(r->out.info->disks[0].disk);
|
||||||
|
|
||||||
r->out.info.disks[1].disk = talloc_strdup(mem_ctx, "");
|
r->out.info->disks[1].disk = talloc_strdup(mem_ctx, "");
|
||||||
W_ERROR_HAVE_NO_MEMORY(r->out.info.disks[1].disk);
|
W_ERROR_HAVE_NO_MEMORY(r->out.info->disks[1].disk);
|
||||||
|
|
||||||
r->out.totalentries = 1;
|
*r->out.totalentries = 1;
|
||||||
r->out.resume_handle = r->in.resume_handle;
|
r->out.resume_handle = r->in.resume_handle;
|
||||||
|
|
||||||
return WERR_OK;
|
return WERR_OK;
|
||||||
|
@ -796,16 +796,23 @@ static bool test_NetDiskEnum(struct torture_context *tctx,
|
|||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct srvsvc_NetDiskEnum r;
|
struct srvsvc_NetDiskEnum r;
|
||||||
|
struct srvsvc_NetDiskInfo info;
|
||||||
|
uint32_t totalentries = 0;
|
||||||
uint32_t levels[] = {0};
|
uint32_t levels[] = {0};
|
||||||
int i;
|
int i;
|
||||||
uint32_t resume_handle=0;
|
uint32_t resume_handle=0;
|
||||||
|
|
||||||
ZERO_STRUCT(r.in);
|
ZERO_STRUCT(info);
|
||||||
|
|
||||||
r.in.server_unc = NULL;
|
r.in.server_unc = NULL;
|
||||||
r.in.resume_handle = &resume_handle;
|
r.in.resume_handle = &resume_handle;
|
||||||
|
r.in.info = &info;
|
||||||
|
r.out.info = &info;
|
||||||
|
r.out.totalentries = &totalentries;
|
||||||
|
r.out.resume_handle = &resume_handle;
|
||||||
|
|
||||||
for (i=0;i<ARRAY_SIZE(levels);i++) {
|
for (i=0;i<ARRAY_SIZE(levels);i++) {
|
||||||
ZERO_STRUCT(r.out);
|
ZERO_STRUCTP(r.out.info);
|
||||||
r.in.level = levels[i];
|
r.in.level = levels[i];
|
||||||
torture_comment(tctx, "testing NetDiskEnum level %u\n", r.in.level);
|
torture_comment(tctx, "testing NetDiskEnum level %u\n", r.in.level);
|
||||||
status = dcerpc_srvsvc_NetDiskEnum(p, tctx, &r);
|
status = dcerpc_srvsvc_NetDiskEnum(p, tctx, &r);
|
||||||
|
Reference in New Issue
Block a user