diff options
author | Simo Sorce <idra@samba.org> | 2006-09-10 03:58:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:08 -0500 |
commit | c74d5b9204c004f30494645f04d34306667990c8 (patch) | |
tree | 4329e36fb59affdb19190d25180c7be0e28ad121 /source4 | |
parent | fb15300c60ee92addc7664ed96d3d21e634b2d0b (diff) | |
download | samba-c74d5b9204c004f30494645f04d34306667990c8.tar.gz samba-c74d5b9204c004f30494645f04d34306667990c8.tar.bz2 samba-c74d5b9204c004f30494645f04d34306667990c8.zip |
r18318: Implement DiskEnum
Fix spelling and consistencies issues in idl
(This used to be commit 1347c971ac4dd62e6e6643293d48917ac065d19c)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/idl/srvsvc.idl | 6 | ||||
-rw-r--r-- | source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 21 |
2 files changed, 21 insertions, 6 deletions
diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl index e33b0da3e5..8cd9d63864 100644 --- a/source4/librpc/idl/srvsvc.idl +++ b/source4/librpc/idl/srvsvc.idl @@ -1121,12 +1121,12 @@ /* srvsvc_NetDisk */ /**************************/ typedef struct { - [flag(STR_LEN4)] string disc; + [flag(STR_LEN4)] string disk; } srvsvc_NetDiskInfo0; typedef struct { uint32 count; - [size_is(count), length_is(count)] srvsvc_NetDiskInfo0 *discs; + [size_is(count), length_is(count)] srvsvc_NetDiskInfo0 *disks; } srvsvc_NetDiskInfo; /******************/ @@ -1134,7 +1134,7 @@ WERROR srvsvc_NetDiskEnum( [in] [string,charset(UTF16)] uint16 *server_unc, [in] uint32 level, - [in,out] srvsvc_NetDiskInfo disks, + [in,out] srvsvc_NetDiskInfo info, [in] uint32 maxlen, [out] uint32 totalentries, [in,out] uint32 *resume_handle diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c index d852f7a40c..d850af5ebd 100644 --- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c +++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c @@ -1078,15 +1078,30 @@ static WERROR srvsvc_NetSrvSetInfo(struct dcesrv_call_state *dce_call, TALLOC_CT static WERROR srvsvc_NetDiskEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct srvsvc_NetDiskEnum *r) { - r->out.disks.discs = NULL; - r->out.disks.count = 0; + r->out.info.disks = NULL; + r->out.info.count = 0; r->out.totalentries = 0; r->out.resume_handle = NULL; switch (r->in.level) { case 0: { - return WERR_NOT_SUPPORTED; + /* 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 */ + r->out.info.disks = talloc_array(mem_ctx, struct srvsvc_NetDiskInfo0, 2); + W_ERROR_HAVE_NO_MEMORY(r->out.info.disks); + r->out.info.count = 2; + + r->out.info.disks[0].disk = talloc_strdup(mem_ctx, "C:"); + W_ERROR_HAVE_NO_MEMORY(r->out.info.disks[0].disk); + + r->out.info.disks[1].disk = talloc_strdup(mem_ctx, ""); + W_ERROR_HAVE_NO_MEMORY(r->out.info.disks[1].disk); + + r->out.totalentries = 1; + r->out.resume_handle = r->in.resume_handle; + + return WERR_OK; } default: return WERR_UNKNOWN_LEVEL; |