⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phprop.h

📁 Windows CE 6.0 Server 源码
💻 H
📖 第 1 页 / 共 2 页
字号:
{
    return m_ulApplicationTag;
}

/*======================================================================

 Function:    CPropertyHeader::SetBody

 Description: Get Message body size

 =======================================================================*/
inline void CPropertyHeader::SetBody(const UCHAR * pBody, ULONG ulSize, ULONG ulAllocSize)
{
    m_ulAllocBodySize = ulAllocSize;
    m_ulBodySize = ulSize;
    memcpy(&m_awTitle[TitleLengthInBytes + m_ulExtensionSize], pBody, ulSize);
}

/*======================================================================

 Function:    CPropertyHeader::GetBody

 Description: Get Message body size

 =======================================================================*/
inline void CPropertyHeader::GetBody(PUCHAR pBody, ULONG ulSize) const
{
    memcpy( pBody,
            &m_awTitle[TitleLengthInBytes + m_ulExtensionSize],
            ((ulSize < m_ulBodySize) ?  ulSize : m_ulBodySize)
            );
}

/*======================================================================

 Function:    CPropertyHeader::GetBodyPtr

 Description: Get Message body size

 =======================================================================*/
inline const UCHAR* CPropertyHeader::GetBodyPtr() const
{
    return (PUCHAR)&m_awTitle[TitleLengthInBytes + m_ulExtensionSize];
}
/*======================================================================

 Function:    CPropertyHeader::GetBodySize

 Description: Get Message body size

 =======================================================================*/
inline ULONG CPropertyHeader::GetBodySize(void) const
{
    return m_ulBodySize;
}

/*======================================================================

 Function:    CPropertyHeader::SetBodySize

 Description: Set Message body size

 =======================================================================*/
inline void CPropertyHeader::SetBodySize(ULONG ulBodySize)
{
    ASSERT(ulBodySize <= m_ulAllocBodySize);
    m_ulBodySize = ulBodySize;
}

/*======================================================================

 Function:    CPropertyHeader::GetAllocBodySize

 Description: Get the allocated message body size

 =======================================================================*/
inline ULONG CPropertyHeader::GetAllocBodySize(void) const
{
    return m_ulAllocBodySize;
}

/*======================================================================

 Function:    CPropertyHeader::SetMsgExtension

 Description: Set Message Extension

 =======================================================================*/
inline void
CPropertyHeader::SetMsgExtension(const UCHAR* pMsgExtension,
                                 ULONG ulSize)
{
    m_ulExtensionSize = ulSize;
    memcpy(&m_awTitle[TitleLengthInBytes], pMsgExtension, ulSize);
}

/*======================================================================

 Function:    CPropertyHeader::GetMsgExtension

 Description: Get Message Extension

 =======================================================================*/
inline void
CPropertyHeader::GetMsgExtension(PUCHAR pMsgExtension,
                                 ULONG ulSize) const
{
    memcpy( pMsgExtension,
            &m_awTitle[TitleLengthInBytes],
            ((ulSize < m_ulExtensionSize) ?  ulSize : m_ulExtensionSize)
            );
}

/*======================================================================

 Function:    CPropertyHeader::GetMsgExtensionPtr

 Description: Get pointer to Message Extension

 =======================================================================*/
inline const UCHAR*
CPropertyHeader::GetMsgExtensionPtr(void) const
{
    return &m_awTitle[TitleLengthInBytes];
}

/*======================================================================

 Function:    CPropertyHeader::GetMsgExtensionSize

 Description: Get Message Extension size

 =======================================================================*/
inline ULONG CPropertyHeader::GetMsgExtensionSize(void) const
{
    return m_ulExtensionSize;
}

/*======================================================================

 Function:    CPropertyHeader::SetTitle

 Description: Set Message title

 =======================================================================*/
#ifndef MAXBYTE
// MAXBYTE is not in ntdef.h (DDK), MAXUCHAR is not define for winnt.h (WINDOWS)
#define MAXBYTE 0xff
#endif
inline void CPropertyHeader::SetTitle(const WCHAR* pwTitle, ULONG ulTitleLength)
{
    if(ulTitleLength > MAXBYTE)
    {
        ulTitleLength = MAXBYTE;
    }

    m_bTitleLength = (UCHAR)ulTitleLength;
    memcpy(m_awTitle, pwTitle, ulTitleLength * sizeof(WCHAR));
}

/*======================================================================

 Function:    CPropertyHeader::GetTitle

 Description: Get Message title

 =======================================================================*/
inline void CPropertyHeader::GetTitle(PWCHAR pwTitle, ULONG ulBufferSizeInWCHARs) const
{
    if(ulBufferSizeInWCHARs > m_bTitleLength)
    {
        ulBufferSizeInWCHARs = m_bTitleLength;
    }

    if(ulBufferSizeInWCHARs == 0)
    {
        return;
    }

    --ulBufferSizeInWCHARs;

    memcpy(pwTitle, m_awTitle, ulBufferSizeInWCHARs * sizeof(WCHAR));
    pwTitle[ulBufferSizeInWCHARs] = L'\0';
}

/*======================================================================

 Function:    CPropertyHeader::GetTitlePtr

 Description: Get Message title

 =======================================================================*/
inline const WCHAR* CPropertyHeader::GetTitlePtr(void) const
{
    return ((WCHAR*)m_awTitle);
}

/*======================================================================

 Function:    CPropertyHeader::GetTitleSize

 Description: Get the size of Message title

 =======================================================================*/
inline ULONG CPropertyHeader::GetTitleLength(void) const
{
    return(m_bTitleLength);
}

/*======================================================================

 Function:    CPropertyHeader::SetPrivLevel

 Description: Set the privacy level of the message in the message packet.

 =======================================================================*/
inline void CPropertyHeader::SetPrivLevel(ULONG ulPrivLevel)
{
    m_ulPrivLevel = ulPrivLevel;
}

/*======================================================================

 Function:    CPropertyHeader::GetPrivLevel

 Description: Get the privacy level of the message in the message packet.

 =======================================================================*/
inline ULONG CPropertyHeader::GetPrivLevel(void) const
{
    return(m_ulPrivLevel);
}

/*======================================================================

 Function:    CPropertyHeader::SetHashAlg

 Description: Set the hash algorithm of the message in the message packet.

 =======================================================================*/
inline void CPropertyHeader::SetHashAlg(ULONG ulHashAlg)
{
    m_ulHashAlg = ulHashAlg;
}

/*======================================================================

 Function:    CPropertyHeader::GetHashAlg

 Description: Get the hash algorithm of the message in the message packet.

 =======================================================================*/
inline ULONG CPropertyHeader::GetHashAlg(void) const
{
    return(m_ulHashAlg);
}

/*======================================================================

 Function:    CPropertyHeader::SetEncryptAlg

 Description: Set the encryption algorithm of the message in the message packet.

 =======================================================================*/
inline void CPropertyHeader::SetEncryptAlg(ULONG ulEncryptAlg)
{
    m_ulEncryptAlg = ulEncryptAlg;
}

/*======================================================================

 Function:    CPropertyHeader::GetEncryptAlg

 Description: Get the encryption algorithm of the message in the message packet.

 =======================================================================*/
inline ULONG CPropertyHeader::GetEncryptAlg(void) const
{
    return(m_ulEncryptAlg);
}

/*======================================================================

 Function:    CPropertyHeader::SetBodyType

 =======================================================================*/
inline void CPropertyHeader::SetBodyType(ULONG ulBodyType)
{
    m_ulBodyType = ulBodyType;
}

/*======================================================================

 Function:    CPropertyHeader::GetBodyType

 =======================================================================*/
inline ULONG CPropertyHeader::GetBodyType(void) const
{
    return  m_ulBodyType;
}

#endif // __PHPROP_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -