G
Guest
I've built wizard application in .NET 2003. In the CPropertyPage constructor,
last param is passed by default as sizeof(PROPSHEETPAGE). Since I have
defined _WIN32_WINNT as 0x0500, this size is passed in as 48 (which is fine).
AllocPSP() in the constructor is now allocating 48 bytes. When I stepped during runtime into constructor code and further, in the following function:
void CPropertyPage::CommonConstruct(LPCTSTR lpszTemplateName, UINT
nIDCaption, UINT nIDHeaderTitle, UINT nIDHeaderSubTitle
CommonConstruct(lpszTemplateName, nIDCaption)
if (nIDHeaderTitle != 0
VERIFY(m_strHeaderTitle.LoadString(nIDHeaderTitle))
m_psp.dwSize = sizeof(m_psp); //here the size is always 52 bytes
if (nIDHeaderSubTitle != 0
VERIFY(m_strHeaderSubTitle.LoadString(nIDHeaderSubTitle))
m_psp.dwSize = sizeof(m_psp);//here the size is always 52 bytes
m_psp.dwSize is overwritten as 52, since sizeof(m_psp) is compiled in the lib
as 52 bytes. In the disassembly, you can clearly see it
Eventually my application is crashing because of corrupted memory.
So if I build my application with _WIN32_WINNT defined as 0x0500, I have
buffer read overrun problems. Maybe Microsoft people should check this and
verify
At the moment, how do I solve this problem?
last param is passed by default as sizeof(PROPSHEETPAGE). Since I have
defined _WIN32_WINNT as 0x0500, this size is passed in as 48 (which is fine).
AllocPSP() in the constructor is now allocating 48 bytes. When I stepped during runtime into constructor code and further, in the following function:
void CPropertyPage::CommonConstruct(LPCTSTR lpszTemplateName, UINT
nIDCaption, UINT nIDHeaderTitle, UINT nIDHeaderSubTitle
CommonConstruct(lpszTemplateName, nIDCaption)
if (nIDHeaderTitle != 0
VERIFY(m_strHeaderTitle.LoadString(nIDHeaderTitle))
m_psp.dwSize = sizeof(m_psp); //here the size is always 52 bytes
if (nIDHeaderSubTitle != 0
VERIFY(m_strHeaderSubTitle.LoadString(nIDHeaderSubTitle))
m_psp.dwSize = sizeof(m_psp);//here the size is always 52 bytes
m_psp.dwSize is overwritten as 52, since sizeof(m_psp) is compiled in the lib
as 52 bytes. In the disassembly, you can clearly see it
Eventually my application is crashing because of corrupted memory.
So if I build my application with _WIN32_WINNT defined as 0x0500, I have
buffer read overrun problems. Maybe Microsoft people should check this and
verify
At the moment, how do I solve this problem?