2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 #include <dos/dosextens.h>
7 /*****************************************************************************
11 #include <libraries/nonvolatile.h>
12 #include <exec/memory.h>
13 #include <proto/exec.h>
14 #include <proto/nvdisk.h>
17 AROS_LH1(struct NVInfo
*, GetNVInfo
,
21 AROS_LHA(BOOL
, killRequesters
, D1
),
25 struct Library
*, nvBase
, 9, Nonvolatile
)
29 Report information on the user's preferred nonvolatile storage device.
33 killRequesters -- if TRUE no system requesters will be displayed during
34 the operation of this function
38 Pointer to an NVInfo structure containing the information on the nonvolatile
39 storage device currently in use. Returns NULL in case of a failure.
49 FreeNVData(), StoreNV(), <libraries/nonvolatile.h>
53 ******************************************************************************/
58 struct Process
*me
= (struct Process
*)FindTask(NULL
);
59 APTR oldReq
= me
->pr_WindowPtr
;
60 struct NVInfo
*info
= AllocVec(sizeof(struct NVInfo
), MEMF_ANY
);
66 me
->pr_WindowPtr
= (APTR
)-1;
68 /* Try to get the information from the HIDD */
71 /* Round down to nearest 10 bytes */
72 info
->nvi_MaxStorage
= (info
->nvi_MaxStorage
/10)*10;
73 info
->nvi_FreeStorage
= (info
->nvi_FreeStorage
/10)*10;
82 me
->pr_WindowPtr
= oldReq
;