/ Map the entire index file. */ /
| 2492 | /* Map the entire index file. */ |
| 2493 | /*********************************************************************/ |
| 2494 | void *XFILE::FileView(PGLOBAL g, char *fn) |
| 2495 | { |
| 2496 | HANDLE h; |
| 2497 | |
| 2498 | Mmp = (MMP)PlugSubAlloc(g, NULL, sizeof(MEMMAP)); |
| 2499 | h = CreateFileMap(g, fn, Mmp, MODE_READ, false); |
| 2500 | |
| 2501 | if (h == INVALID_HANDLE_VALUE || (!Mmp->lenH && !Mmp->lenL)) { |
| 2502 | if (!(*g->Message)) |
| 2503 | strcpy(g->Message, MSG(FILE_MAP_ERR)); |
| 2504 | |
| 2505 | CloseFileHandle(h); // Not used anymore |
| 2506 | return NULL; // No saved values |
| 2507 | } // endif h |
| 2508 | |
| 2509 | CloseFileHandle(h); // Not used anymore |
| 2510 | return Mmp->memory; |
| 2511 | } // end of FileView |
| 2512 | #endif // XMAP |
| 2513 | |
| 2514 | /* -------------------------- XHUGE Class --------------------------- */ |
no test coverage detected