2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <exec/memory.h>
9 #include <proto/exec.h>
10 #include <dos/exall.h>
11 #include <dos/rdargs.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(void, FreeDosObject
,
22 AROS_LHA(ULONG
, type
, D1
),
23 AROS_LHA(APTR
, ptr
, D2
),
26 struct DosLibrary
*, DOSBase
, 39, Dos
)
29 Frees an object allocated with AllocDosObject.
32 type - object type. The same parameter as given to AllocDosObject().
33 ptr - Pointer to object.
47 *****************************************************************************/
55 struct FileHandle
*fh
=(struct FileHandle
*)ptr
;
56 if(fh
->fh_Flags
&FHF_BUF
)
57 FreeMem(fh
->fh_Buf
,fh
->fh_Size
);
58 FreeMem(fh
,sizeof(struct FileHandle
));
62 FreeMem(ptr
,sizeof(struct FileInfoBlock
));
66 FreeMem((APTR
)(ptr
-(APTR
)(&((struct StandardPacket
*)0)->sp_Pkt
)),sizeof(struct StandardPacket
));
69 case DOS_EXALLCONTROL
:
70 if (((struct InternalExAllControl
*)ptr
)->fib
)
71 FreeDosObject(DOS_FIB
, ((struct InternalExAllControl
*)ptr
)->fib
);
73 FreeMem(ptr
, sizeof(struct InternalExAllControl
));
78 struct CommandLineInterface
*cli
=(struct CommandLineInterface
*)ptr
;
80 cur
=(BPTR
*)BADDR(cli
->cli_CommandDir
);
81 FreeVec(BADDR(cli
->cli_SetName
));
82 FreeVec(BADDR(cli
->cli_CommandName
));
83 FreeVec(BADDR(cli
->cli_CommandFile
));
84 FreeVec(BADDR(cli
->cli_Prompt
));
85 FreeMem(ptr
,sizeof(struct CommandLineInterface
));
88 next
=(BPTR
*)BADDR(cur
[0]);
96 FreeArgs() will not free a RDArgs without a RDA_DAList,
97 see that function for more information as to why...
100 if(((struct RDArgs
*)ptr
)->RDA_DAList
!= NULL
)
109 } /* FreeDosObject */