/////////////////////////////////////////////////////////////////////////
| 1397 | ////////////////////////////////////////////////////////////////////////////// |
| 1398 | // |
| 1399 | CImageImportFile * CImage::NewByway(_In_ LPCSTR pszName) |
| 1400 | { |
| 1401 | CImageImportFile *pImportFile = new NOTHROW CImageImportFile; |
| 1402 | if (pImportFile == NULL) { |
| 1403 | SetLastError(ERROR_OUTOFMEMORY); |
| 1404 | goto fail; |
| 1405 | } |
| 1406 | |
| 1407 | pImportFile->m_pNextFile = NULL; |
| 1408 | pImportFile->m_fByway = TRUE; |
| 1409 | |
| 1410 | pImportFile->m_pszName = DuplicateString(pszName); |
| 1411 | if (pImportFile->m_pszName == NULL) { |
| 1412 | goto fail; |
| 1413 | } |
| 1414 | |
| 1415 | pImportFile->m_rvaOriginalFirstThunk = 0; |
| 1416 | pImportFile->m_rvaFirstThunk = 0; |
| 1417 | pImportFile->m_nForwarderChain = (UINT)0; |
| 1418 | pImportFile->m_pImportNames = NULL; |
| 1419 | pImportFile->m_nImportNames = 0; |
| 1420 | |
| 1421 | m_nImportFiles++; |
| 1422 | return pImportFile; |
| 1423 | |
| 1424 | fail: |
| 1425 | if (pImportFile) { |
| 1426 | delete pImportFile; |
| 1427 | pImportFile = NULL; |
| 1428 | } |
| 1429 | return NULL; |
| 1430 | } |
| 1431 | |
| 1432 | BOOL CImage::EditImports(PVOID pContext, |
| 1433 | PF_DETOUR_BINARY_BYWAY_CALLBACK pfBywayCallback, |
nothing calls this directly
no test coverage detected