%HAXELIB_ROOT%/systools/1,1,0/project/src/win/icons.h
/*
 * Map a file into memory for reading.
 *
 * Pointer returned must be freed with UnmapViewOfFile().
 */
Map a file into memory for reading.
Pointer returned must be freed with UnmapViewOfFile().
Map a file into memory for reading . Pointer returned must be freed with UnmapViewOfFile () .
static char *MapExistingFile (const char*path, DWORD *psize)
{
    HANDLE hFile, hFileMapping;
    DWORD nSizeLow, nSizeHigh;
    char *data;
    hFile = CreateFile
			( path,GENERIC_READ, FILE_SHARE_READ, NULL
			, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL
			);
    if (hFile == INVALID_HANDLE_VALUE)
		return NULL;
    nSizeLow = GetFileSize(hFile, &nSizeHigh);
    hFileMapping = CreateFileMapping(hFile,
				     NULL, PAGE_READONLY, 0, 0, NULL);
    CloseHandle (hFile);
    if (hFileMapping == INVALID_HANDLE_VALUE)
		return NULL;
    data = MapViewOfFile(hFileMapping,FILE_MAP_READ, 0, 0, 0);
    CloseHandle(hFileMapping);
    *psize = nSizeLow;
    return data;
}
static char * MapExistingFile ( const char * path , DWORD * psize ) { HANDLE hFile , hFileMapping ; DWORD nSizeLow , nSizeHigh ; char * data ; hFile = CreateFile ( path , GENERIC_READ , FILE_SHARE_READ , NULL , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , NULL ) ; if ( hFile == INVALID_HANDLE_VALUE ) return NULL ; nSizeLow = GetFileSize ( hFile , & nSizeHigh ) ; hFileMapping = CreateFileMapping ( hFile , NULL , PAGE_READONLY , 0 , 0 , NULL ) ; CloseHandle ( hFile ) ; if ( hFileMapping == INVALID_HANDLE_VALUE ) return NULL ; data = MapViewOfFile ( hFileMapping , FILE_MAP_READ , 0 , 0 , 0 ) ; CloseHandle ( hFileMapping ) ; * psize = nSizeLow ; return data ; }
Map a file into memory for reading.
Map a file into memory for reading .