Chameleon

Chameleon Svn Source Tree

Root/branches/rekursor/i386/libsaio/freebsd.c

1#include "libsaio.h"
2#include "sl.h"
3#include "freebsd.h"
4
5#define FreeBSDProbeSize2048
6
7bool FreeBSDProbe (const void *buf)
8{
9return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119);
10}
11void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen)
12{
13char * buf=malloc(FreeBSDProbeSize);
14str[0]=0;
15if (!buf)
16return;
17Seek(ih, 0);
18Read(ih, (long)buf, FreeBSDProbeSize);
19if (!FreeBSDProbe (buf))
20{
21free (buf);
22return;
23}
24if (OSReadLittleInt32 (buf+0x44c,0)<1)
25{
26free (buf);
27return;
28}
29str[strMaxLen]=0;
30strncpy (str, buf+0x478, MIN (strMaxLen, 32));
31free (buf);
32}
33

Archive Download this file

Revision: 1698