📄 qinfo.cpp
字号:
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutPathName
//=--------------------------------------------------------------------------=
//
// Parameters:
// bstrPathName [in] this queue's PathName
// pbstrPathName [in] where to put it
//
// Output:
// HRESULT - S_OK, E_OUTOFMEMORY
//
// Notes:
//
#if 0 // no longer used
HRESULT CMSMQQueueInfo::PutPathName(
BSTR bstrPathName,
BSTR *pbstrPathName)
{
SysFreeString(*pbstrPathName);
IfNullRet(*pbstrPathName = SYSALLOCSTRING(bstrPathName));
return NOERROR;
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::put_PathName
//=--------------------------------------------------------------------------=
//
// Parameters:
// bstrPathName [in] this queue's pathname
//
// Output:
// HRESULT - S_OK, E_OUTOFMEMORY
//
// Notes:
//
HRESULT CMSMQQueueInfo::put_PathName(BSTR bstrPathName)
{
HRESULT hresult = NOERROR;
//
// note: we don't update the Falcon property --
// the user must explicitly create/open to
// use this new pathname.
//
EnterCriticalSection(&m_CSlocal);
SysFreeString(m_bstrPathName);
m_bstrPathName = SYSALLOCSTRING(bstrPathName);
if(m_bstrPathName == NULL)
hresult = E_OUTOFMEMORY;
else
m_isValidFormatName = FALSE;
//
// formatname is now invalid
//
LeaveCriticalSection(&m_CSlocal);
return hresult;
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get_FormatName
//=--------------------------------------------------------------------------=
//
// Parameters:
// pbstrFormatName [out] this queue's format name
//
// Output:
// HRESULT - S_OK
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_FormatName(BSTR *pbstrFormatName)
{
//
// UNDONE: if the formatname is no longer valid, shouldn't
// we refresh it immediately via MQPathNameToFormatName
// since otherwise we're returning something out of date
// to the user?
//
IfNullRet(*pbstrFormatName = SYSALLOCSTRING(m_bstrFormatName));
#if DEBUG
RemBstrNode(*pbstrFormatName);
#endif // DEBUG
return NOERROR;
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutFormatName
//=--------------------------------------------------------------------------=
//
// Parameters:
// bstrFormatName [in] this queue's FormatName
// pbstrFormatName [in] where to put it
//
// Output:
// HRESULT - S_OK, E_OUTOFMEMORY
//
// Notes:
//
#if 0 // no longer used
HRESULT CMSMQQueueInfo::PutFormatName(
BSTR bstrFormatName,
BSTR *pbstrFormatName)
{
SysFreeString(*pbstrFormatName);
IfNullRet(*pbstrFormatName = SYSALLOCSTRING(bstrFormatName));
return NOERROR;
}
#endif
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::put_FormatName
//=--------------------------------------------------------------------------=
//
// Parameters:
// bstrFormatName [in] this queue's formatname
//
// Output:
// HRESULT - S_OK, E_OUTOFMEMORY
//
// Notes:
//
HRESULT CMSMQQueueInfo::put_FormatName(BSTR bstrFormatName)
{
HRESULT hresult = NOERROR;
//
// note: we don't update the Falcon property --
// the user must explicitly create/open to
// use this new pathname.
//
EnterCriticalSection(&m_CSlocal);
SysFreeString(m_bstrFormatName);
m_bstrFormatName = SYSALLOCSTRING(bstrFormatName);
if(m_bstrFormatName == NULL)
hresult = E_OUTOFMEMORY;
else
m_isValidFormatName = TRUE;
//
// formatname is now valid
//
LeaveCriticalSection(&m_CSlocal);
return hresult;
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get_IsTransactional
//=--------------------------------------------------------------------------=
//
// Parameters:
// pisTransactional [out]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_IsTransactional(VARIANT_BOOL *pisTransactional)
{
InitProps();
*pisTransactional = m_isTransactional;
return NOERROR;
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutPrivLevel
//=--------------------------------------------------------------------------=
//
// Parameters:
// plPrivLevel [out]
// lPrivLevel [in]
//
// Output:
//
// Notes:
//
#if 0 // no longer used
HRESULT CMSMQQueueInfo::PutPrivLevel(
long lPrivLevel,
long *plPrivLevel)
{
switch (lPrivLevel) {
case MQ_PRIV_LEVEL_NONE:
case MQ_PRIV_LEVEL_OPTIONAL:
case MQ_PRIV_LEVEL_BODY:
*plPrivLevel = lPrivLevel;
return NOERROR;
default:
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get/put_PrivLevel
//=--------------------------------------------------------------------------=
//
// Parameters:
// plPrivLevel [out]
// lPrivLevel [in]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_PrivLevel(long *plPrivLevel)
{
InitProps();
*plPrivLevel = m_lPrivLevel;
return NOERROR;
}
HRESULT CMSMQQueueInfo::put_PrivLevel(long lPrivLevel)
{
switch (lPrivLevel) {
case MQ_PRIV_LEVEL_NONE:
case MQ_PRIV_LEVEL_OPTIONAL:
case MQ_PRIV_LEVEL_BODY:
EnterCriticalSection(&m_CSlocal);
m_lPrivLevel = lPrivLevel;
LeaveCriticalSection(&m_CSlocal);
return NOERROR;
default:
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutJournal
//=--------------------------------------------------------------------------=
//
// Parameters:
// plJournal [out]
// lJournal [in]
//
// Output:
//
// Notes:
//
#if 0 // no longer used
HRESULT CMSMQQueueInfo::PutJournal(
long lJournal,
long *plJournal)
{
switch (lJournal) {
case MQ_JOURNAL_NONE:
case MQ_JOURNAL:
*plJournal = lJournal;
return NOERROR;
default:
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
#endif
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get/put_Journal
//=--------------------------------------------------------------------------=
//
// Parameters:
// plJournal [out]
// lJournal [in]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_Journal(long *plJournal)
{
InitProps();
*plJournal = m_lJournal;
return NOERROR;
}
HRESULT CMSMQQueueInfo::put_Journal(long lJournal)
{
switch (lJournal) {
case MQ_JOURNAL_NONE:
case MQ_JOURNAL:
EnterCriticalSection(&m_CSlocal);
m_lJournal = lJournal;
LeaveCriticalSection(&m_CSlocal);
return NOERROR;
default:
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutQuota
//=--------------------------------------------------------------------------=
//
// Parameters:
// plQuota [out]
// lQuota [in]
//
// Output:
//
// Notes:
//
#if 0 // no longer used
inline HRESULT CMSMQQueueInfo::PutQuota(long lQuota, long *plQuota)
{
// UNDONE: validate...
*plQuota = lQuota;
return NOERROR;
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get/put_quota
//=--------------------------------------------------------------------------=
//
// Parameters:
// plQuota [out]
// lQuota [in]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_Quota(long *plQuota)
{
InitProps();
*plQuota = m_lQuota;
return NOERROR;
}
HRESULT CMSMQQueueInfo::put_Quota(long lQuota)
{
EnterCriticalSection(&m_CSlocal);
m_lQuota = lQuota;
LeaveCriticalSection(&m_CSlocal);
return NOERROR;
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutBasePriority
//=--------------------------------------------------------------------------=
//
// Parameters:
// plBasePriority [out]
// lBasePriority [in]
//
// Output:
//
// Notes:
//
#if 0 // no longer used
inline HRESULT CMSMQQueueInfo::PutBasePriority(
long lBasePriority,
long *plBasePriority)
{
if ((lBasePriority >= (long)SHRT_MIN) &&
(lBasePriority <= (long)SHRT_MAX)) {
*plBasePriority = lBasePriority;
return NOERROR;
}
else {
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get/put_BasePriority
//=--------------------------------------------------------------------------=
//
// Parameters:
// plBasePriority [out]
// lBasePriority [in]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_BasePriority(long *plBasePriority)
{
InitProps();
*plBasePriority = m_lBasePriority;
return NOERROR;
}
HRESULT CMSMQQueueInfo::put_BasePriority(long lBasePriority)
{
if ((lBasePriority >= (long)SHRT_MIN) &&
(lBasePriority <= (long)SHRT_MAX)) {
EnterCriticalSection(&m_CSlocal);
m_lBasePriority = lBasePriority;
LeaveCriticalSection(&m_CSlocal);
return NOERROR;
}
else {
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get_CreateTime/dateModifyTime
//=--------------------------------------------------------------------------=
//
// Parameters:
// pvarCreateTime [out]
// pvarModifyTime [out]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_CreateTime(VARIANT *pvarCreateTime)
{
InitProps();
return GetVariantTimeOfTime(m_lCreateTime, pvarCreateTime);
}
HRESULT CMSMQQueueInfo::get_ModifyTime(VARIANT *pvarModifyTime)
{
InitProps();
return GetVariantTimeOfTime(m_lModifyTime, pvarModifyTime);
}
#if 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get_strCreateTime/strModifyTime
//=--------------------------------------------------------------------------=
//
// Parameters:
// pbstrCreateTime [out]
// pbstrModifyTime [out]
//
// Output:
//
// Notes:
//
HRESULT CMSMQQueueInfo::get_strCreateTime(BSTR *pbstrCreateTime)
{
//
// 1271: uninit'ed time will return the empty string
//
IfNullRet(*pbstrCreateTime =
m_lCreateTime ?
BstrOfTime(m_lCreateTime) :
SysAllocString(L""));
#if DEBUG
RemBstrNode(*pbstrCreateTime);
#endif // DEBUG
return NOERROR;
}
HRESULT CMSMQQueueInfo::get_strModifyTime(BSTR *pbstrModifyTime)
{
IfNullRet(*pbstrModifyTime =
m_lModifyTime ?
BstrOfTime(m_lModifyTime) :
SysAllocString(L""));
#if DEBUG
RemBstrNode(*pbstrModifyTime);
#endif // DEBUG
return NOERROR;
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::PutAuthenticate
//=--------------------------------------------------------------------------=
//
// Parameters:
// plAuthenticate [out]
// lAuthenticate [in]
//
// Output:
//
// Notes:
//
#if 0 // no longer used
inline HRESULT CMSMQQueueInfo::PutAuthenticate(
long lAuthenticate,
long *plAuthenticate)
{
switch (lAuthenticate) {
case MQ_AUTHENTICATE_NONE:
case MQ_AUTHENTICATE:
*plAuthenticate = lAuthenticate;
return NOERROR;
default:
return CreateErrorHelper(
MQ_ERROR_ILLEGAL_PROPERTY_VALUE,
m_ObjectType);
}
}
#endif // 0
//=--------------------------------------------------------------------------=
// CMSMQQueueInfo::get/put_Authenticate
//=--------------------------------------------------------------------------=
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -