Pradipmaya Maharana
2011-Nov-22 23:58 UTC
[Samba] dcerpc_svcctl_ChangeServiceConfig2W fails with DCERPC_FAULT_INVALID_TAG
Hi All, I am trying to change the service description through dcerpc_svcctl_ChangeServiceConfig2W() and I am getting the error DCERPC_FAULT_INVALID_TAG. What am I doing wrong? Following is the snippet of code. #define DESC_STRING "Test Description" /* the pipe and handle are valid */ NTSTATUS changeServiceDescription (struct dcerpc_pipe * svc_pipe, struct policy_handle * psvc_handle) { NTSTATUS status; struct svcctl_ChangeServiceConfig2W config; struct SERVICE_DESCRIPTION svcDesc; char *ctx = NULL; ctx = talloc(NULL, char); svcDesc.description = talloc_zero_size(ctx, strlen(DESC_STRING)+1); if (svcDesc.description != NULL){ strncpy(svcDesc.description, DESC_STRING, strlen(DESC_STRING)); config.in.handle = psvc_handle; config.in.info_level = SERVICE_CONFIG_DESCRIPTION; config.in.info = &svcDesc; status = dcerpc_svcctl_ChangeServiceConfig2W(svc_pipe, NULL, &config); status = NT_RES(status, config.out.result); TALLOC_FREE(ctx); } return NT_RES(status, r.out.result); } Thanks and Regards, Paddy.