• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OPENCHANGE_RETVAL_IF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OPENCHANGE_RETVAL_IF函数的典型用法代码示例。如果您正苦于以下问题:C++ OPENCHANGE_RETVAL_IF函数的具体用法?C++ OPENCHANGE_RETVAL_IF怎么用?C++ OPENCHANGE_RETVAL_IF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了OPENCHANGE_RETVAL_IF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Save

/**
   \details Save (commit) message in openchangedb database

   \param msg the message object
   \param SaveFlags flags associated to the save operation

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_ enum MAPISTATUS openchangedb_message_save(void *_msg, uint8_t SaveFlags)
{
	struct openchangedb_message *msg = (struct openchangedb_message *)_msg;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!msg, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!msg->ldb_ctx, MAPI_E_NOT_INITIALIZED, NULL);

	switch (msg->status) {
	case OPENCHANGEDB_MESSAGE_CREATE:
		OPENCHANGE_RETVAL_IF(!msg->msg, MAPI_E_NOT_INITIALIZED, NULL);
		if (ldb_add(msg->ldb_ctx, msg->msg) != LDB_SUCCESS) {
			return MAPI_E_CALL_FAILED;
		}
		break;
	case OPENCHANGEDB_MESSAGE_OPEN:
		if (ldb_modify(msg->ldb_ctx, msg->res->msgs[0]) != LDB_SUCCESS) {
			return MAPI_E_CALL_FAILED;
		}
		break;
	}

	/* FIXME: Deal with SaveFlags */

	return MAPI_E_SUCCESS;
}
开发者ID:josephpaulk,项目名称:openchange,代码行数:34,代码来源:openchangedb_message.c


示例2: Logoff

/**
   \details Logoff an Exchange store

   This function uninitializes the MAPI session associated to the
   object.

   \param obj_store pointer to the store object

   \return MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND
 */
_PUBLIC_ enum MAPISTATUS Logoff(mapi_object_t *obj_store)
{
    struct mapi_context	*mapi_ctx;
    struct mapi_session	*session;
    struct mapi_session	*el;
    bool			found = false;

    /* Sanity checks */
    session = mapi_object_get_session(obj_store);
    OPENCHANGE_RETVAL_IF(!session, MAPI_E_INVALID_PARAMETER, NULL);

    mapi_ctx = session->mapi_ctx;
    OPENCHANGE_RETVAL_IF(!mapi_ctx, MAPI_E_NOT_INITIALIZED, NULL);

    for (el = mapi_ctx->session; el; el = el->next) {
        if (session == el) {
            found = true;
            mapi_object_release(obj_store);
            DLIST_REMOVE(mapi_ctx->session, el);
            MAPIFreeBuffer(session);
            break;
        }
    }

    return (found == true) ? MAPI_E_SUCCESS : MAPI_E_NOT_FOUND;
}
开发者ID:proxymoron,项目名称:openchange,代码行数:36,代码来源:IMSProvider.c


示例3: addresses

/**
   \details Retrieve the total number of records in the global address
   list

   The Global Address List is the full list of email addresses (and other
   account-type things, such as "rooms" and distribution lists) accessible
   on the server. A user will usually have access to both a personal
   address book, and to the Global Address List. Public Address Book is
   another name for Global Address List.

   \param session pointer to the MAPI session context
   \param totalRecs pointers to the total number of records in the
   global address list returned

   \return MAPI_E_SUCCESS on success, otherwise MAPI error.

   \note Developers may also call GetLastError() to retrieve the last
   MAPI error code. Possible MAPI error codes are:
   -# MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
   -# MAPI_E_SESSION_LIMIT: No session has been opened on the provider
   -# MAPI_E_INVALID_PARAMETER: if a function parameter is invalid
   -# MAPI_E_CALL_FAILED: A network problem was encountered during the
     transaction
 */
_PUBLIC_ enum MAPISTATUS GetGALTableCount(struct mapi_session *session,
					  uint32_t *totalRecs)
{
	TALLOC_CTX		*mem_ctx;
	struct nspi_context	*nspi;
	enum MAPISTATUS		retval;
	struct PropertyRowSet_r	*rowset;

	/* Sanity Checks */
	OPENCHANGE_RETVAL_IF(!session, MAPI_E_SESSION_LIMIT, NULL);
	OPENCHANGE_RETVAL_IF(!session->nspi, MAPI_E_SESSION_LIMIT, NULL);
	OPENCHANGE_RETVAL_IF(!session->nspi->ctx, MAPI_E_SESSION_LIMIT, NULL);

	mem_ctx = talloc_named(session, 0, "GetGALTableCount");
	nspi = (struct nspi_context *) session->nspi->ctx;

	nspi->pStat->CurrentRec = 0;
	nspi->pStat->Delta = 0;
	nspi->pStat->NumPos = 0;
	nspi->pStat->TotalRecs = 0xffffffff;

	rowset = talloc_zero(mem_ctx, struct PropertyRowSet_r);
	retval = nspi_QueryRows(nspi, mem_ctx, NULL, NULL, 0, &rowset);

	*totalRecs = nspi->pStat->TotalRecs;
	
	OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
	talloc_free(mem_ctx);
	
	return MAPI_E_SUCCESS;
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:55,代码来源:IABContainer.c


示例4: name

/**
   \details Get the organization name (like "First Organization") as a DN.

   \param emsmdbp_ctx pointer to the EMSMDBP context
   \param basedn pointer to the returned struct ldb_dn

   \return MAPI_E_SUCCESS or an error if something happens
 */
_PUBLIC_ enum MAPISTATUS emsmdbp_get_org_dn(struct emsmdbp_context *emsmdbp_ctx, struct ldb_dn **basedn)
{
	enum MAPISTATUS		retval;
	int			ret;
	struct ldb_result	*res = NULL;
	char			*org_name;

	OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!emsmdbp_ctx->samdb_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!basedn, MAPI_E_INVALID_PARAMETER, NULL);

	retval = emsmdbp_fetch_organizational_units(emsmdbp_ctx, emsmdbp_ctx, &org_name, NULL);
	OPENCHANGE_RETVAL_IF(retval != MAPI_E_SUCCESS, retval, NULL);

	ret = ldb_search(emsmdbp_ctx->samdb_ctx, emsmdbp_ctx, &res,
			 ldb_get_config_basedn(emsmdbp_ctx->samdb_ctx),
                         LDB_SCOPE_SUBTREE, NULL,
                         "(&(objectClass=msExchOrganizationContainer)(cn=%s))",
                         ldb_binary_encode_string(emsmdbp_ctx, org_name));
	talloc_free(org_name);

	/* If the search failed */
        if (ret != LDB_SUCCESS) {
	  	DEBUG(1, ("emsmdbp_get_org_dn ldb_search failure.\n"));
		return MAPI_E_NOT_FOUND;
        }

	*basedn = ldb_dn_new(emsmdbp_ctx, emsmdbp_ctx->samdb_ctx,
			     ldb_msg_find_attr_as_string(res->msgs[0], "distinguishedName", NULL));
	return MAPI_E_SUCCESS;
}
开发者ID:antmd,项目名称:openchange,代码行数:39,代码来源:emsmdbp.c


示例5: nspi_GetTemplateInfo

/**
   \details Returns information about template objects in the address
   book.

   \param nspi_ctx pointer to the NSPI memory context
   \param mem_ctx pointer to the memory context
   \param dwFlags set of bit flags
   \param ulType specifies the display type of the template
   \param pDN the DN of the template requested
   \param ppData pointer on pointer to the data requested

   Possible values for dwFlags:
   -# TI_TEMPLATE to return the template
   -# TI_SCRIPT to return the script associated to the template
   -# TI_EMT to return the e-mail type associated to the template
   -# TI_HELPFILE_NAME to return the help file associated to the
      template
   -# TI_HELPFILE_CONTENTS to return the contents of the help file
      associated to the template
   \return MAPI_E_SUCCESS on success, otherwise MAPI error.
 */
_PUBLIC_ enum MAPISTATUS nspi_GetTemplateInfo(struct nspi_context *nspi_ctx,
					      TALLOC_CTX *mem_ctx,
					      uint32_t dwFlags,
					      uint32_t ulType,
					      char *pDN,
					      struct PropertyRow_r **ppData)
{
	struct NspiGetTemplateInfo	r;
	NTSTATUS			status;
	enum MAPISTATUS			retval;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!ppData, MAPI_E_INVALID_PARAMETER, NULL);

	r.in.handle = &nspi_ctx->handle;
	r.in.dwFlags = dwFlags;
	r.in.ulType = ulType;
	r.in.pDN = pDN;
	r.in.dwCodePage = nspi_ctx->pStat->CodePage;
	r.in.dwLocaleID = nspi_ctx->pStat->TemplateLocale;
	
	r.out.ppData = ppData;

	status = dcerpc_NspiGetTemplateInfo_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), retval, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);
	

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:54,代码来源:nspi.c


示例6: nspi_UpdateStat

/**
   \details Updates the STAT block representing position in a table to
   reflect positioning changes requested by the client.

   \param nspi_ctx pointer to the NSPI connection context
   \param mem_ctx pointer to the memory context
   \param plDelta pointer to an unsigned long indicating movement
   within the address book container specified by the input parameter
   pStat.

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_ enum MAPISTATUS nspi_UpdateStat(struct nspi_context *nspi_ctx, 
					 TALLOC_CTX *mem_ctx,
					 uint32_t *plDelta)
{
	struct NspiUpdateStat		r;
	NTSTATUS			status;
	enum MAPISTATUS			retval;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!plDelta, MAPI_E_INVALID_PARAMETER, NULL);

	r.in.handle = &nspi_ctx->handle;
	r.in.Reserved = 0x0;

	r.in.pStat = nspi_ctx->pStat;
	r.in.plDelta = plDelta;

	r.out.pStat = nspi_ctx->pStat;
	r.out.plDelta = r.in.plDelta;

	status = dcerpc_NspiUpdateStat_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), retval, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:41,代码来源:nspi.c


示例7: SetSearchCriteria

/**
   \details EcDoRpc SetSearchCriteria (0x30) Rop. This operation sets
   the search criteria for a search folder.

   \param mem_ctx pointer to the memory context
   \param emsmdbp_ctx pointer to the emsmdb provider context
   \param mapi_req pointer to the SetSearchCriteria EcDoRpc_MAPI_REQ
   structure
   \param mapi_repl pointer to the SetSearchCriteria EcDoRpc_MAPI_REPL
   structure
   \param handles pointer to the MAPI handles array
   \param size pointer to the mapi_response size to update

   \return MAPI_E_SUCCESS on success, otherwise MAPI error  
 */
_PUBLIC_ enum MAPISTATUS EcDoRpc_RopSetSearchCriteria(TALLOC_CTX *mem_ctx,
						      struct emsmdbp_context *emsmdbp_ctx,
						      struct EcDoRpc_MAPI_REQ *mapi_req,
						      struct EcDoRpc_MAPI_REPL *mapi_repl,
						      uint32_t *handles, uint16_t *size)
{
	OC_DEBUG(4, "exchange_emsmdb: [OXCFOLD] SetSearchCriteria (0x30)\n");

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!mapi_repl, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);

	mapi_repl->opnum = mapi_req->opnum;
	mapi_repl->handle_idx = mapi_req->handle_idx;
	mapi_repl->error_code = MAPI_E_SUCCESS;

	/* TODO: actually implement this */

	*size += libmapiserver_RopSetSearchCriteria_size(mapi_repl);

	return MAPI_E_SUCCESS;
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:40,代码来源:oxcfold.c


示例8: emsabp_EphemeralEntryID_to_Binary_r

/**
   \details Map an EphemeralEntryID structure into a Binary_r structure

   \param mem_ctx pointer to the memory context
   \param ephEntryID pointer to the Ephemeral EntryID structure
   \param bin pointer to the Binary_r structure the server will return

   \return MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER
 */
_PUBLIC_ enum MAPISTATUS emsabp_EphemeralEntryID_to_Binary_r(TALLOC_CTX *mem_ctx,
							     struct EphemeralEntryID *ephEntryID,
							     struct Binary_r *bin)
{
	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!ephEntryID, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!bin, MAPI_E_INVALID_PARAMETER, NULL);

	bin->cb = sizeof (*ephEntryID);
	bin->lpb = talloc_array(mem_ctx, uint8_t, bin->cb);

	/* Copy EphemeralEntryID into bin->lpb */
	memset(bin->lpb, 0, bin->cb);
	bin->lpb[0] = ephEntryID->ID_type;
	bin->lpb[1] = ephEntryID->R1;
	bin->lpb[2] = ephEntryID->R2;
	bin->lpb[3] = ephEntryID->R3;
	memcpy(bin->lpb + 4, ephEntryID->ProviderUID.ab, 16);
	bin->lpb[20] = (ephEntryID->R4 & 0xFF);
	bin->lpb[21] = ((ephEntryID->R4 >> 8)  & 0xFF);
	bin->lpb[22] = ((ephEntryID->R4 >> 16) & 0xFF);
	bin->lpb[23] = ((ephEntryID->R4 >> 24) & 0xFF);
	bin->lpb[24] = (ephEntryID->DisplayType & 0xFF);
	bin->lpb[25] = ((ephEntryID->DisplayType >> 8)  & 0xFF);
	bin->lpb[26] = ((ephEntryID->DisplayType >> 16) & 0xFF);
	bin->lpb[27] = ((ephEntryID->DisplayType >> 24) & 0xFF);
	bin->lpb[28] = (ephEntryID->MId & 0xFF);
	bin->lpb[29] = ((ephEntryID->MId >> 8)  & 0xFF);
	bin->lpb[30] = ((ephEntryID->MId >> 16) & 0xFF);
	bin->lpb[31] = ((ephEntryID->MId >> 24) & 0xFF);

	return MAPI_E_SUCCESS;
}
开发者ID:inverse-inc,项目名称:openchange.old,代码行数:42,代码来源:emsabp.c


示例9: nspi_CompareMIds

/**
   \details Compares the position in an address book container of two
   objects identified by MId and returns the value of the comparison

   \param nspi_ctx pointer to the NSPI connection context
   \param mem_ctx pointer to the memory context
   \param MId1 the first MId to compare
   \param MId2 the second MId to compare
   \param plResult pointer to the value of the comparison

   \return MAPI_E_SUCCESS on success, otherwise MAPI error.
 */
_PUBLIC_ enum MAPISTATUS nspi_CompareMIds(struct nspi_context *nspi_ctx,
					  TALLOC_CTX *mem_ctx,
					  uint32_t MId1, uint32_t MId2,
					  uint32_t *plResult)
{
	struct NspiCompareMIds	r;
	NTSTATUS		status;
	enum MAPISTATUS		retval;

	/* Sanity Checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!plResult, MAPI_E_INVALID_PARAMETER, NULL);

	r.in.handle = &nspi_ctx->handle;
	r.in.Reserved = 0x0;
	r.in.pStat = nspi_ctx->pStat;
	r.in.MId1 = MId1;
	r.in.MId2 = MId2;

	r.out.plResult = plResult;

	status = dcerpc_NspiCompareMIds_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), retval, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:41,代码来源:nspi.c


示例10: nspi_QueryColumns

/**
   \details Returns a list of all the properties the NSPI server is
   aware off.

   \param nspi_ctx pointer to the NSPI connection context
   \param mem_ctx pointer to the memory context
   \param WantUnicode whether we want UNICODE properties or not
   \param ppColumns pointer on pointer to a property tag array

   \return MAPI_E_SUCCESS on success, otherwise MAPI error.
 */
_PUBLIC_ enum MAPISTATUS nspi_QueryColumns(struct nspi_context *nspi_ctx,
					   TALLOC_CTX *mem_ctx,
					   bool WantUnicode,
					   struct SPropTagArray **ppColumns)
{
	struct NspiQueryColumns	r;
	NTSTATUS		status;
	enum MAPISTATUS		retval;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!ppColumns, MAPI_E_INVALID_PARAMETER, NULL);

	r.in.handle = &nspi_ctx->handle;
	r.in.Reserved = 0x0;
	r.in.dwFlags = (WantUnicode != false) ? NspiUnicodeProptypes : 0x0;
	
	r.out.ppColumns = ppColumns;

	status = dcerpc_NspiQueryColumns_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), MAPI_E_CALL_FAILED, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:38,代码来源:nspi.c


示例11: emsabp_set_EphemeralEntryID

/**
   \details Build an EphemeralEntryID structure

   \param emsabp_ctx pointer to the EMSABP context
   \param DisplayType the AB object display type
   \param MId the MId value
   \param ephEntryID pointer to the EphemeralEntryID returned by the
   function

   \return MAPI_E_SUCCESS on success, otherwise
   MAPI_E_NOT_ENOUGH_RESOURCES or MAPI_E_CORRUPT_STORE
 */
_PUBLIC_ enum MAPISTATUS emsabp_set_EphemeralEntryID(struct emsabp_context *emsabp_ctx,
						     uint32_t DisplayType, uint32_t MId,
						     struct EphemeralEntryID *ephEntryID)
{
	struct GUID	*guid = (struct GUID *) NULL;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!ephEntryID, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);

	guid = (struct GUID *) samdb_ntds_objectGUID(emsabp_ctx->samdb_ctx);
	OPENCHANGE_RETVAL_IF(!guid, MAPI_E_CORRUPT_STORE, NULL);

	ephEntryID->ID_type = 0x87;
	ephEntryID->R1 = 0x0;
	ephEntryID->R2 = 0x0;
	ephEntryID->R3 = 0x0;
	ephEntryID->ProviderUID.ab[0] = (guid->time_low & 0xFF);
	ephEntryID->ProviderUID.ab[1] = ((guid->time_low >> 8)  & 0xFF);
	ephEntryID->ProviderUID.ab[2] = ((guid->time_low >> 16) & 0xFF);
	ephEntryID->ProviderUID.ab[3] = ((guid->time_low >> 24) & 0xFF);
	ephEntryID->ProviderUID.ab[4] = (guid->time_mid & 0xFF);
	ephEntryID->ProviderUID.ab[5] = ((guid->time_mid >> 8)  & 0xFF);
	ephEntryID->ProviderUID.ab[6] = (guid->time_hi_and_version & 0xFF);
	ephEntryID->ProviderUID.ab[7] = ((guid->time_hi_and_version >> 8) & 0xFF);
	memcpy(ephEntryID->ProviderUID.ab + 8,  guid->clock_seq, sizeof (uint8_t) * 2);
	memcpy(ephEntryID->ProviderUID.ab + 10, guid->node, sizeof (uint8_t) * 6);
	ephEntryID->R4 = 0x1;
	ephEntryID->DisplayType = DisplayType;
	ephEntryID->MId = MId;

	return MAPI_E_SUCCESS;
}
开发者ID:inverse-inc,项目名称:openchange.old,代码行数:44,代码来源:emsabp.c


示例12: nspi_GetPropList

/**
   \details Returns a list of all the properties that have values on
   the specified object

   \param nspi_ctx pointer to the NSPI connection context
   \param mem_ctx pointer to the memory context
   \param WantObject boolean value defining whether we want the server
   to include properties with the type set to PT_OBJECT
   \param dwMId the MId of the specified object
   \param ppPropTags pointer on pointer to the list of property tags
   associated to the object.

   \return MAPI_E_SUCCESS on success, otherwise MAPI error.
 */
_PUBLIC_ enum MAPISTATUS nspi_GetPropList(struct nspi_context *nspi_ctx,
					  TALLOC_CTX *mem_ctx,
					  bool WantObject,
					  uint32_t dwMId,
					  struct SPropTagArray **ppPropTags)
{
	struct NspiGetPropList	r;
	NTSTATUS		status;
	enum MAPISTATUS		retval;

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!ppPropTags, MAPI_E_INVALID_PARAMETER, NULL);
	
	r.in.handle = &nspi_ctx->handle;
	r.in.dwFlags = (WantObject == true) ? 0x0 : fSkipObjects;
	r.in.dwMId = dwMId;
	r.in.CodePage = nspi_ctx->pStat->CodePage;
	
	r.out.ppPropTags = ppPropTags;

	status = dcerpc_NspiGetPropList_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), retval, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:43,代码来源:nspi.c


示例13: GetFIDFromEntryID

/**
   \details Create a FID from an EntryID

   \param cb count of lpb bytes
   \param lpb pointer on an array of bytes
   \param parent_fid the parent folder identifier
   \param fid pointer to the returned fid

   \return MAPI_E_SUCCESS on success, otherwise
   MAPI_E_INVALID_PARAMETER
 */
_PUBLIC_ enum MAPISTATUS GetFIDFromEntryID(uint16_t cb, 
					   uint8_t *lpb, 
					   uint64_t parent_fid, 
					   uint64_t *fid)
{
	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!lpb, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!fid, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(cb < 8, MAPI_E_INVALID_PARAMETER, NULL);

	*fid = 0;
	*fid += ((uint64_t)lpb[cb - 3] << 56);
	*fid += ((uint64_t)lpb[cb - 4] << 48);
	*fid += ((uint64_t)lpb[cb - 5] << 40);
	*fid += ((uint64_t)lpb[cb - 6] << 32);
	*fid += ((uint64_t)lpb[cb - 7] << 24);
	*fid += ((uint64_t)lpb[cb - 8] << 16);
	/* WARNING: for some unknown reason the latest byte of folder
	   ID may change (0x1 or 0x4 values identified so far).
	   However this byte sounds the same than the parent folder
	   one */
	*fid += (parent_fid & 0xFFFF);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:36,代码来源:utils.c


示例14: GetSearchCriteria

/**
   \details EcDoRpc GetSearchCriteria (0x31) Rop. This operation gets
   the search criteria for a search folder.

   \param mem_ctx pointer to the memory context
   \param emsmdbp_ctx pointer to the emsmdb provider context
   \param mapi_req pointer to the GetSearchCriteria EcDoRpc_MAPI_REQ
   structure
   \param mapi_repl pointer to the GetSearchCriteria EcDoRpc_MAPI_REPL
   structure
   \param handles pointer to the MAPI handles array
   \param size pointer to the mapi_response size to update

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_ enum MAPISTATUS EcDoRpc_RopGetSearchCriteria(TALLOC_CTX *mem_ctx,
						      struct emsmdbp_context *emsmdbp_ctx,
						      struct EcDoRpc_MAPI_REQ *mapi_req,
						      struct EcDoRpc_MAPI_REPL *mapi_repl,
						      uint32_t *handles, uint16_t *size)
{
	/* struct mapi_SRestriction *res; */

	OC_DEBUG(4, "exchange_emsmdb: [OXCFOLD] GetSearchCriteria (0x31)\n");

	/* Sanity checks */
	OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!mapi_repl, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
	OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);

	mapi_repl->opnum = mapi_req->opnum;
	mapi_repl->handle_idx = mapi_req->handle_idx;
	mapi_repl->error_code = MAPI_E_SUCCESS;

	/* res = NULL; */
	mapi_repl->u.mapi_GetSearchCriteria.RestrictionDataSize = 0;
	mapi_repl->u.mapi_GetSearchCriteria.LogonId = mapi_req->logon_id;
	mapi_repl->u.mapi_GetSearchCriteria.FolderIdCount = 0;
	mapi_repl->u.mapi_GetSearchCriteria.FolderIds = NULL;
	mapi_repl->u.mapi_GetSearchCriteria.SearchFlags = 0;

	/* TODO: actually implement this */

	*size += libmapiserver_RopGetSearchCriteria_size(mapi_repl);

	return MAPI_E_SUCCESS;
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:49,代码来源:oxcfold.c


示例15: Save

/**
   \details Save (commit) message in openchangedb database

   \param msg the message object
   \param SaveFlags flags associated to the save operation

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_
enum MAPISTATUS openchangedb_message_save(struct openchangedb_context *oc_ctx,
					  void *msg, uint8_t SaveFlags)
{
	OPENCHANGE_RETVAL_IF(!oc_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!msg, MAPI_E_NOT_INITIALIZED, NULL);

	return oc_ctx->message_save(oc_ctx, msg, SaveFlags);
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:17,代码来源:openchangedb_message.c


示例16: GetLastError

/**
   \details Free allocated memory

   This function frees memory previously allocated with
   MAPIAllocateBuffer.

   \param ptr memory region to free
       
   \return MAPI_E_SUCCESS on success, otherwise MAPI error.

   \note Developers may also call GetLastError() to retrieve the last
   MAPI error code. Possible MAPI error codes are:
   - MAPI_E_INVALID_PARAMER: ptr is not set properly.

   \sa MAPIAllocateBuffer, GetLastError
*/
_PUBLIC_ enum MAPISTATUS MAPIFreeBuffer(void *ptr)
{
	int		ret;

	OPENCHANGE_RETVAL_IF(!ptr, MAPI_E_INVALID_PARAMETER, NULL);

	ret = talloc_free(ptr);
	OPENCHANGE_RETVAL_IF(ret == -1, MAPI_E_INVALID_PARAMETER, NULL);

	return MAPI_E_SUCCESS;
}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:27,代码来源:IUnknown.c


示例17: openchangedb_message_open

/**
   \details Initialize and open a message object

   \param mem_ctx pointer to the memory context to use for allocation
   \param oc_ctx pointer to the openchangedb context
   \param username the name of the mailbox where the parent folder of the
   message is.
   \param messageID the identifier of the message to open
   \param folderID the identifier of the folder where the message is stored
   \param message_object pointer on pointer to the message object to return
   \param msgp pointer on pointer to the mapistore message to return

   \return MAPI_E_SUCCESS on success, otherwise MAPISTORE error
 */
_PUBLIC_
enum MAPISTATUS openchangedb_message_open(TALLOC_CTX *mem_ctx,
					  struct openchangedb_context *oc_ctx,
					  const char *username,
					  uint64_t messageID, uint64_t folderID,
					  void **message_object, void **msgp)
{
	OPENCHANGE_RETVAL_IF(!oc_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!message_object, MAPI_E_NOT_INITIALIZED, NULL);

	return oc_ctx->message_open(mem_ctx, oc_ctx, username, messageID,
				    folderID, message_object, msgp);
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:27,代码来源:openchangedb_message.c


示例18: openchangedb_message_set_properties

/**
   \details Set a list of properties on a message

   \param mem_ctx pointer to the memory context
   \param message_object pointer to the openchangedb message object
   \param row pointer to the SRow structure holding the array of
   properties to set on the message

   \return MAPI_E_SUCCESS on success, otherwise MAPI errors.
 */
_PUBLIC_
enum MAPISTATUS openchangedb_message_set_properties(TALLOC_CTX *mem_ctx,
						    struct openchangedb_context *oc_ctx,
						    void *message_object,
						    struct SRow *row)
{
	OPENCHANGE_RETVAL_IF(!oc_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!message_object, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!row, MAPI_E_NOT_INITIALIZED, NULL);

	return oc_ctx->message_set_properties(mem_ctx, oc_ctx, message_object,
					      row);
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:23,代码来源:openchangedb_message.c


示例19: openchangedb_message_get_property

/**
   \details Retrieve a property on a LDB message

   \param mem_ctx pointer to the memory context
   \param message_object the openchangedb message to retrieve data from
   \param proptag the MAPI property tag to lookup
   \param data pointer on pointer to the data to return

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_
enum MAPISTATUS openchangedb_message_get_property(TALLOC_CTX *mem_ctx,
						  struct openchangedb_context *oc_ctx,
						  void *message_object,
						  uint32_t proptag, void **data)
{
	OPENCHANGE_RETVAL_IF(!oc_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!message_object, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!data, MAPI_E_NOT_INITIALIZED, NULL);

	return oc_ctx->message_get_property(mem_ctx, oc_ctx, message_object,
					    proptag, data);
}
开发者ID:ThHirsch,项目名称:openchange,代码行数:23,代码来源:openchangedb_message.c


示例20: nspi_QueryRows

/**
   \details Returns a number of Rows from a specified table.

   \param nspi_ctx pointer to the NSPI connection context
   \param mem_ctx pointer to the memory context
   \param pPropTags pointer to the list of proptags that the client
   requires to be returned for each row.
   \param MIds pointer to a list of values representing an Explicit
   table
   \param count the number of rows requested
   \param ppRows pointer on pointer to the the rows returned by the
   server

   \return MAPI_E_SUCCESS on success, otherwise MAPI error
 */
_PUBLIC_ enum MAPISTATUS nspi_QueryRows(struct nspi_context *nspi_ctx, 
					TALLOC_CTX *mem_ctx,
					struct SPropTagArray *pPropTags,
					struct PropertyTagArray_r *MIds, 
					uint32_t count,
					struct PropertyRowSet_r **ppRows)
{
	struct NspiQueryRows		r;
	NTSTATUS			status;
	enum MAPISTATUS			retval;
	struct STAT			*pStat;

	/* Sanity Checks */
	OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
	OPENCHANGE_RETVAL_IF(!mem_ctx, MAPI_E_INVALID_PARAMETER, NULL);

	r.in.handle = &nspi_ctx->handle;
	r.in.dwFlags = 0x0;
	r.in.pStat = nspi_ctx->pStat;

	if (MIds && MIds->cValues) {
		r.in.dwETableCount = MIds->cValues;
		r.in.lpETable = (uint32_t *) MIds->aulPropTag;
		/* We set CurrentRec to the first entry */
		r.in.pStat->CurrentRec = MIds->aulPropTag[0];
	} else {
		r.in.dwETableCount = 0;
		r.in.lpETable = NULL;
	}

	r.in.Count = count;	
 	r.in.pPropTags = pPropTags;

	pStat = talloc(mem_ctx, struct STAT);
	r.out.pStat = pStat;

	r.out.ppRows = ppRows;

	status = dcerpc_NspiQueryRows_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
	retval = r.out.result;
	OPENCHANGE_RETVAL_IF(!NT_STATUS_IS_OK(status), retval, NULL);
	OPENCHANGE_RETVAL_IF(retval, retval, NULL);

	nspi_ctx->pStat->CurrentRec = r.out.pStat->CurrentRec;
	nspi_ctx->pStat->Delta = r.out.pStat->Delta;
	nspi_ctx->pStat->NumPos = r.out.pStat->NumPos;
	nspi_ctx->pStat->TotalRecs = r.out.pStat->TotalRecs;

	return MAPI_E_SUCCESS;

}
开发者ID:EasyLinux,项目名称:Openchange,代码行数:66,代码来源:nspi.c



注:本文中的OPENCHANGE_RETVAL_IF函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OPENSSL_EXIT函数代码示例发布时间:2022-05-30
下一篇:
C++ OPCODE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap