2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 /*****************************************************************************
13 #include "nvdisk_intern.h"
15 #include <dos/dosextens.h>
16 #include <proto/dos.h>
17 #include <proto/exec.h>
18 #include <exec/memory.h>
21 AROS_LH2(APTR
, ReadNVDData
,
25 AROS_LHA(STRPTR
, appName
, A0
),
26 AROS_LHA(STRPTR
, itemName
, A1
),
30 struct Library
*, nvdBase
, 5, NVDisk
)
34 Read the nv data corresponding to appname, itemname.
38 appname -- the name of the application owning the data
39 itemname -- the name of the data to retrieve
43 A pointer to the data read. If something went wrong NULL is returned.
57 November 2000, SDuvan -- implemented
59 ******************************************************************************/
68 /* Allocate a FileInfoBlock to be able to determine the size of the
69 file containing the data. */
70 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
74 oldCDir
= CurrentDir(GPB(nvdBase
)->nvd_location
);
75 lock
= Lock(appName
, SHARED_LOCK
);
81 lock2
= Lock(itemName
, SHARED_LOCK
);
85 // We have now found the file -- check how big it is
88 mem
= AllocVec(fib
->fib_Size
, MEMF_ANY
);
92 if(Read(lock2
, mem
, fib
->fib_Size
) != fib
->fib_Size
)
110 FreeDosObject(DOS_FIB
, fib
);