summaryrefslogtreecommitdiff
path: root/source4/rpc_server/wkssvc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-12-31 02:48:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:48 -0500
commit09ee8ae1deec97bb1df3c1c77d73192e63df4538 (patch)
tree6024f33b725d4598e188aca5171255e2e09cb598 /source4/rpc_server/wkssvc
parentc5fa6f7516dca066359f73b1c4aba3e0d8a4c850 (diff)
downloadsamba-09ee8ae1deec97bb1df3c1c77d73192e63df4538.tar.gz
samba-09ee8ae1deec97bb1df3c1c77d73192e63df4538.tar.bz2
samba-09ee8ae1deec97bb1df3c1c77d73192e63df4538.zip
r4425: - move srvsvc and wkssvc server code to the new W_ERROR_HAVE_NO_MEMORY() macro
- add parameters for server_info:platform_id = 500 /* this is PLATFORM_ID_NT */ server_info:version_major = 5 server_info:version_minor = 2 - implmented srvsvc_NetSrvGetInfo level 101 - make dcesrv_common_get_server_name() match w2k3 metze (This used to be commit 16f43207704397c6e3c0132e9f17c8a1a846ddca)
Diffstat (limited to 'source4/rpc_server/wkssvc')
-rw-r--r--source4/rpc_server/wkssvc/dcesrv_wkssvc.c84
1 files changed, 49 insertions, 35 deletions
diff --git a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
index febe628953..22b13cb873 100644
--- a/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
+++ b/source4/rpc_server/wkssvc/dcesrv_wkssvc.c
@@ -33,47 +33,61 @@ static WERROR wkssvc_NetWkstaGetInfo(struct dcesrv_call_state *dce_call, TALLOC_
{
struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
+ ZERO_STRUCT(r->out);
+
/* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */
switch(r->in.level) {
- case 100: {
- r->out.info.info100 = talloc_p(mem_ctx, struct wkssvc_NetWkstaInfo100);
- WERR_TALLOC_CHECK(r->out.info.info100);
-
- r->out.info.info100->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
- r->out.info.info100->server = dcesrv_common_get_server_name(mem_ctx, dce_ctx);
- r->out.info.info100->domain = dcesrv_common_get_domain_name(mem_ctx, dce_ctx);
- r->out.info.info100->ver_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
- r->out.info.info100->ver_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
- break;
- }
- case 101: {
- r->out.info.info101 = talloc_p(mem_ctx, struct wkssvc_NetWkstaInfo101);
- WERR_TALLOC_CHECK(r->out.info.info101);
-
- r->out.info.info101->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
- r->out.info.info101->server = dcesrv_common_get_server_name(mem_ctx, dce_ctx);
- r->out.info.info101->domain = dcesrv_common_get_domain_name(mem_ctx, dce_ctx);
- r->out.info.info101->ver_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
- r->out.info.info101->ver_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
- r->out.info.info101->lan_root = dcesrv_common_get_lan_root(mem_ctx, dce_ctx);
- break;
- }
- case 102: {
- r->out.info.info102 = NULL;
-
- return WERR_ACCESS_DENIED;
- }
- case 502: {
- r->out.info.info502 = NULL;
-
- return WERR_ACCESS_DENIED;
- }
+ case 100:
+ {
+ struct wkssvc_NetWkstaInfo100 *info100;
+
+ info100 = talloc_p(mem_ctx, struct wkssvc_NetWkstaInfo100);
+ W_ERROR_HAVE_NO_MEMORY(info100);
+
+ info100->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
+ info100->server = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
+ W_ERROR_HAVE_NO_MEMORY(info100->server);
+ info100->domain = dcesrv_common_get_domain_name(mem_ctx, dce_ctx);
+ W_ERROR_HAVE_NO_MEMORY(info100->domain);
+ info100->ver_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
+ info100->ver_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
+
+ r->out.info.info100 = info100;
+ return WERR_OK;
+ }
+ case 101:
+ {
+ struct wkssvc_NetWkstaInfo101 *info101;
+
+ info101 = talloc_p(mem_ctx, struct wkssvc_NetWkstaInfo101);
+ W_ERROR_HAVE_NO_MEMORY(info101);
+
+ info101->platform_id = dcesrv_common_get_platform_id(mem_ctx, dce_ctx);
+ info101->server = dcesrv_common_get_server_name(mem_ctx, dce_ctx, NULL);
+ W_ERROR_HAVE_NO_MEMORY(info101->server);
+ info101->domain = dcesrv_common_get_domain_name(mem_ctx, dce_ctx);
+ W_ERROR_HAVE_NO_MEMORY(info101->domain);
+ info101->ver_major = dcesrv_common_get_version_major(mem_ctx, dce_ctx);
+ info101->ver_minor = dcesrv_common_get_version_minor(mem_ctx, dce_ctx);
+ info101->lan_root = dcesrv_common_get_lan_root(mem_ctx, dce_ctx);
+
+ r->out.info.info101 = info101;
+ return WERR_OK;
+ }
+ case 102:
+ {
+ return WERR_ACCESS_DENIED;
+ }
+ case 502:
+ {
+ return WERR_ACCESS_DENIED;
+ }
default:
return WERR_UNKNOWN_LEVEL;
}
- return WERR_OK;
+ return WERR_UNKNOWN_LEVEL;
}
@@ -130,7 +144,7 @@ static WERROR wkssvc_NetWkstaTransportEnum(struct dcesrv_call_state *dce_call, T
switch (r->in.level) {
case 0:
r->out.ctr.ctr0 = talloc_p(mem_ctx, struct wkssvc_NetWkstaTransportCtr0);
- WERR_TALLOC_CHECK(r->out.ctr.ctr0);
+ W_ERROR_HAVE_NO_MEMORY(r->out.ctr.ctr0);
r->out.ctr.ctr0->count = 0;
r->out.ctr.ctr0->array = NULL;