2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
9 #include <dos/dosextens.h>
11 /*****************************************************************************
15 #include <libraries/nonvolatile.h>
16 #include <proto/exec.h>
17 #include <proto/nvdisk.h>
21 AROS_LH4(BOOL
, SetNVProtection
,
25 AROS_LHA(STRPTR
, appName
, A0
),
26 AROS_LHA(STRPTR
, itemName
, A1
),
27 AROS_LHA(LONG
, mask
, D2
),
28 AROS_LHA(BOOL
, killRequesters
, D1
),
32 struct Library
*, nvBase
, 11, Nonvolatile
)
36 Set the protection attributes for a nonvolatile item.
40 appName -- the application owning the item stored in nonvolatile
42 itemName -- the name of the item to change the protection of
43 mask -- the new protection status
45 killRequesters -- if TRUE no system requesters will be displayed during
46 the operation of this function
50 Success / failure indicator.
54 The only bit that should currently be used in the 'mask' is the DELETE bit.
62 GetNVList(), <libraries/nonvolatile.h>
66 ******************************************************************************/
71 struct Process
*me
= (struct Process
*)FindTask(NULL
);
72 APTR oldReq
= me
->pr_WindowPtr
;
75 if(appName
== NULL
|| itemName
== NULL
)
78 if(strpbrk(appName
, ":/") != NULL
||
79 strpbrk(itemName
, ":/") != NULL
)
83 me
->pr_WindowPtr
= (APTR
)-1;
85 result
= SetProtection(appName
, itemName
, mask
);
88 me
->pr_WindowPtr
= oldReq
;
93 } /* SetNVProtection */