| 892 | } |
| 893 | |
| 894 | PBYTE CImage::AllocateOutput(DWORD cbData, DWORD *pnVirtAddr) |
| 895 | { |
| 896 | cbData = QuadAlign(cbData); |
| 897 | |
| 898 | PBYTE pbData = m_pbOutputBuffer + m_nOutputVirtSize; |
| 899 | |
| 900 | *pnVirtAddr = m_nOutputVirtAddr + m_nOutputVirtSize; |
| 901 | m_nOutputVirtSize += cbData; |
| 902 | |
| 903 | if (m_nOutputVirtSize > m_cbOutputBuffer) { |
| 904 | SetLastError(ERROR_OUTOFMEMORY); |
| 905 | return NULL; |
| 906 | } |
| 907 | |
| 908 | ZeroMemory(pbData, cbData); |
| 909 | |
| 910 | return pbData; |
| 911 | } |
| 912 | |
| 913 | ////////////////////////////////////////////////////////////////////////////// |
| 914 | // |
no test coverage detected