mirror of
https://github.com/ksherlock/mpw.git
synced 2025-05-12 18:04:07 +00:00
PBHOpenDeny/PBHOpenRFDeny
This commit is contained in:
parent
4bf57c6ce4
commit
148b13cdf1
12
toolbox/os.h
12
toolbox/os.h
@ -9,11 +9,13 @@ namespace OS
|
||||
{
|
||||
|
||||
enum {
|
||||
fsCurPerm = 0,
|
||||
fsRdPerm = 1,
|
||||
fsWrPerm = 2,
|
||||
fsRdWrPerm = 3,
|
||||
fsRdWrShPerm = 4,
|
||||
fsCurPerm = 0x00,
|
||||
fsRdPerm = 0x01,
|
||||
fsWrPerm = 0x02,
|
||||
fsRdWrPerm = 0x03,
|
||||
fsRdWrShPerm = 0x04,
|
||||
fsRdDenyPerm = 0x10,
|
||||
fsWrDenyPerm = 0x20
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -396,6 +396,21 @@ namespace OS {
|
||||
}
|
||||
|
||||
|
||||
uint16_t PBHOpenDeny(uint32_t paramBlock)
|
||||
{
|
||||
// AccessParam.ioDenyModes short word matches
|
||||
// up with the permission byte considering it's big-endian.
|
||||
|
||||
Log(" PBHOpenDeny\n");
|
||||
return OS::Open(0xa000);
|
||||
}
|
||||
|
||||
uint16_t PBHOpenRFDeny(uint32_t paramBlock)
|
||||
{
|
||||
Log(" PBHOpenRFDeny\n");
|
||||
return OS::OpenRF(0xa000);
|
||||
}
|
||||
|
||||
uint16_t FSDispatch(uint16_t trap)
|
||||
{
|
||||
|
||||
@ -449,6 +464,12 @@ namespace OS {
|
||||
case 0x001a:
|
||||
return PBHOpenDF(paramBlock);
|
||||
|
||||
case 0x0038:
|
||||
return PBHOpenDeny(paramBlock);
|
||||
|
||||
case 0x0039:
|
||||
return PBHOpenRFDeny(paramBlock);
|
||||
|
||||
default:
|
||||
fprintf(stderr, "HFSDispatch: selector %08x not implemented\n",
|
||||
selector);
|
||||
|
@ -470,6 +470,7 @@ namespace OS { namespace Internal {
|
||||
if (filename.empty()) return MacOS::bdNamErr;
|
||||
|
||||
int access = 0;
|
||||
ioPermission &= ~0x30; // drop deny read/write
|
||||
switch(ioPermission)
|
||||
{
|
||||
case fsWrPerm:
|
||||
|
Loading…
x
Reference in New Issue
Block a user