EMILE/libmacos/GetDCtlEntry.c
2007-09-29 21:27:48 +00:00

31 lines
541 B
C

/*
*
* (c) 2007 Laurent Vivier <Laurent@lvivier.info>
*
*/
#include <stdio.h>
#include <macos/lowmem.h>
#include <macos/devices.h>
DCtlHandle GetDCtlEntry(short refNum)
{
DCtlHandle *currentHandle;
DCtlPtr currentPtr;
short count;
int i;
count = LMGetUnitTableEntryCount();
currentHandle = (DCtlEntry ***) LMGetUTableBase();
for (i = 0; i < count; i++)
{
if (!currentHandle[i])
continue;
currentPtr = *(currentHandle[i]);
if (currentPtr->dCtlRefNum == refNum)
return currentHandle[i];
}
return (DCtlHandle)0;
}