S
slackcode
I use MiniMFC in Linux. And found the function InterlockedDecrement
don't has the "return xxx":
LONG InterlockedDecrement ( LONG *lpAddend )
{
*lpAddend = *lpAddend - 1;
}
I write a test program like this function, and it return the value of
*lpAddend without the return sentence in the end of the function.
Maybe It return EAX by default, but I'm not sure about that.
CString of MiniMFC use this function like:
void CString::Release()
{
if (GetData() != _afxDataNil)
{
ASSERT(GetData()->nRefs != 0);
if (InterlockedDecrement(&GetData()->nRefs) <= 0)
FreeData(GetData());
Init();
}
}
So the return value of InterlockedDecrement is very important. And I
am not sure the return value and the CString::Release() will occur
some mistagke
don't has the "return xxx":
LONG InterlockedDecrement ( LONG *lpAddend )
{
*lpAddend = *lpAddend - 1;
}
I write a test program like this function, and it return the value of
*lpAddend without the return sentence in the end of the function.
Maybe It return EAX by default, but I'm not sure about that.
CString of MiniMFC use this function like:
void CString::Release()
{
if (GetData() != _afxDataNil)
{
ASSERT(GetData()->nRefs != 0);
if (InterlockedDecrement(&GetData()->nRefs) <= 0)
FreeData(GetData());
Init();
}
}
So the return value of InterlockedDecrement is very important. And I
am not sure the return value and the CString::Release() will occur
some mistagke