mirror of
https://github.com/sheumann/AFPBridge.git
synced 2024-11-01 01:05:06 +00:00
33c4871183
This is necessary because FIListSessions2 has a bug that causes it to return garbage in the server/zone fields for DSI sessions. (The bug is essentially that PFI is indexing into its own tables based on the ASP/DSI session number, rather than properly using a PFI-level session index.)
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#pragma noroot
|
|
|
|
#include <types.h>
|
|
#include <AppleTalk.h>
|
|
#include "asmglue.h"
|
|
#include "cmdproc.h"
|
|
#include "installcmds.h"
|
|
|
|
typedef struct NewCmd {
|
|
Word cmdNum;
|
|
void (*cmdAddr)(void);
|
|
LongWord *jslOldCmdLocation;
|
|
} NewCmd;
|
|
|
|
NewCmd newCmds[] = {
|
|
{aspGetStatusCommand, cmdProc, NULL},
|
|
{aspOpenSessionCommand, cmdProc, NULL},
|
|
{aspCloseSessionCommand, cmdProc, NULL},
|
|
{aspCommandCommand, cmdProc, NULL},
|
|
{aspWriteCommand, cmdProc, NULL},
|
|
{nbpLookupNameCommand, nbpCmdProc, NULL},
|
|
{pfiLoginCommand, pfiLoginCmdProc, &jslOldPFILogin},
|
|
{pfiLogin2Command, pfiLogin2CmdProc, &jslOldPFILogin2},
|
|
{pfiListSessions2Command, pfiListSessions2CmdProc, &jslOldPFIListSessions2},
|
|
{0, 0, 0}
|
|
};
|
|
|
|
LongWord *cmdTable = (LongWord *)0xE1D600;
|
|
|
|
LongWord oldCmds[MAX_CMD + 1]; /* holds old entries for commands we changed */
|
|
|
|
#define JSL 0x22
|
|
|
|
void installCmds(void) {
|
|
Word savedStateReg;
|
|
NewCmd *cmd;
|
|
|
|
savedStateReg = ForceLCBank2();
|
|
|
|
for (cmd = newCmds; cmd->cmdNum != 0; cmd++) {
|
|
oldCmds[cmd->cmdNum] = cmdTable[cmd->cmdNum];
|
|
cmdTable[cmd->cmdNum] =
|
|
(oldCmds[cmd->cmdNum] & 0xFF000000) | (LongWord)cmd->cmdAddr;
|
|
if (cmd->jslOldCmdLocation != NULL)
|
|
*cmd->jslOldCmdLocation = JSL | (oldCmds[cmd->cmdNum] << 8);
|
|
}
|
|
|
|
RestoreStateReg(savedStateReg);
|
|
}
|