📄 snorsub.c
字号:
/* Beholder RMON ethernet network monitor,Copyright (C) 1993 DNPAP group *//* See file COPYING 'GNU General Public Licence' for copyright details */#include "snordef.h"#include "snorerr.h"#include "snorsub.h"USHORT SnorSubInit(SNOR_DESCR *snor){ USHORT ret; if ( (ret=DosSubSet(snor->sel[0], 0x1, 0)) != 0 ) { SnorErrPrint("DosSnorSubSet failed %d", ret); } return(ret);}PVOID SnorSubMalloc(SNOR_DESCR *snor, USHORT size){ USHORT ret; USHORT offset; SEL sel; size += 4; sel = snor->sel[0]; if ( (ret=DosSubAlloc(sel, &offset, size)) != 0 ) { SnorErrPrint("DosSubAlloc failed %d", ret); offset = sel = 0; } else { *(PUSHORT)(MAKEP(sel, offset)) = size; offset += 4; } return(MAKEP(sel, offset));}VOID SnorSubFree(SNOR_DESCR *snor, PVOID p){ USHORT ret; USHORT offset; USHORT size; if ( SELECTOROF(p) != snor->sel[0] ) SnorErrPrint("Invalid selector in SnorSubFree"); else { size = ((PUSHORT)p)[-2]; offset = OFFSETOF(p)-4; if ( (ret=DosSubFree(snor->sel[0], offset, size)) != 0 ) SnorErrPrint("DosSnorSubFree failed %d", ret); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -