static int samldb_extended_allocate_rid(struct ldb_module *module, struct ldb_request *req)
{
	struct ldb_context *ldb = ldb_module_get_ctx(module);
	struct dsdb_extended_allocate_rid *exop;
	int ret;

	exop = talloc_get_type(req->op.extended.data,
			       struct dsdb_extended_allocate_rid);
	if (!exop) {
		ldb_set_errstring(ldb,
				  "samldb_extended_allocate_rid: invalid extended data");
		return LDB_ERR_PROTOCOL_ERROR;
	}

	ret = ridalloc_allocate_rid(module, &exop->rid, req);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);
}
static int samldb_extended_allocate_rid(struct ldb_module *module, struct ldb_request *req)
{
	struct ldb_context *ldb = ldb_module_get_ctx(module);
	struct dsdb_extended_allocate_rid *exop;
	int ret;

	exop = talloc_get_type(req->op.extended.data,
			       struct dsdb_extended_allocate_rid);
	if (!exop) {
		ldb_set_errstring(ldb,
				  "samldb_extended_allocate_rid: invalid extended data");
		return LDB_ERR_PROTOCOL_ERROR;
	}

	ret = ridalloc_allocate_rid(module, &exop->rid, req);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);
}