Exemple #1
0
static NTSTATUS get_eventlog_handle(struct rpc_pipe_client *cli,
				    TALLOC_CTX *mem_ctx,
				    const char *log,
				    struct policy_handle *handle)
{
	NTSTATUS status, result;
	struct eventlog_OpenUnknown0 unknown0;
	struct lsa_String logname, servername;
	struct dcerpc_binding_handle *b = cli->binding_handle;

	unknown0.unknown0 = 0x005c;
	unknown0.unknown1 = 0x0001;

	init_lsa_String(&logname, log);
	init_lsa_String(&servername, NULL);

	status = dcerpc_eventlog_OpenEventLogW(b, mem_ctx,
					       &unknown0,
					       &logname,
					       &servername,
					       0x00000001, /* major */
					       0x00000001, /* minor */
					       handle,
					       &result);
	if (!NT_STATUS_IS_OK(status)) {
		return status;
	}

	return result;
}
Exemple #2
0
static bool get_policy_handle(struct torture_context *tctx, 
							  struct dcerpc_pipe *p,
							  struct policy_handle *handle)
{
	struct eventlog_OpenEventLogW r;
	struct eventlog_OpenUnknown0 unknown0;

	unknown0.unknown0 = 0x005c;
	unknown0.unknown1 = 0x0001;

	r.in.unknown0 = &unknown0;
	init_lsa_String(&r.in.logname, "dns server");
	init_lsa_String(&r.in.servername, NULL);
	r.in.unknown2 = 0x00000001;
	r.in.unknown3 = 0x00000001;
	r.out.handle = handle;

	torture_assert_ntstatus_ok(tctx, 
			dcerpc_eventlog_OpenEventLogW(p, tctx, &r), 
			"OpenEventLog failed");

	torture_assert_ntstatus_ok(tctx, r.out.result, "OpenEventLog failed");

	return true;
}