From: | Sensei |
Date: | 11 Aug 2001 at 02:16:38 |
Subject: | [amiga-c] Allocating FileInfoBlock (Re: ExamineFH) |
Czesc Alexander!
Dnia 10-Aug-01, Alexander Niven-Jenkins napisa�:
> Firstly you need to allocate the memory for "fibb" as you have just
> declared a pointer; secondly most of the OS dos routines need aligned data
> so you need to allocate it with something like AllocVec(). See a quick
> example below.
All exec.library memory allocation functions are returning at least 4 byte
aligned memory, so you can use AllocMem() as well.
If you're allocating FileInfoBlock structure you should use AllocDosObject(
DOS_FIB, NULL ); and free it using FreeDosObject( DOS_FIB, fib ); instead of
AllocMem()/AllocVec() or anything else...
Twelvebullets remember, when you're allocating resources you HAVE TO check
return value! It's VERY bad if you're not doing it even in test/example
program...
Regards!
Przemyslaw 'SENSEI' Gruchala
code/gfx2d/gfx3d/webmaster
Amiga 1200
Apollo 1240/33 MHz, 18 MB RAM, BTC 33.6 bps
HDD 3.2 GB, HDD 520 MB, CD x12
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/