home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
kill9.zip
/
xfree86
/
src
/
death
/
deathapi.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-29
|
931b
|
39 lines
/* Copyright (C)1996 by Holger.Veit@gmd.de */
/* This code may be freely used in own software */
#define INCL_DOS
#define INCL_ERRORS
#include <os2.h>
#include <stdio.h>
#include "death.h"
APIRET death(PID pid)
{
APIRET rc;
HFILE hfd;
ULONG action,plen;
USHORT param;
if ((rc=DosOpen((PSZ)"/dev/fastio$", (PHFILE)&hfd, (PULONG)&action,
(ULONG)0, FILE_SYSTEM, FILE_OPEN,
OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT|OPEN_ACCESS_READONLY,
(ULONG)0))) {
fputs("Error opening fastio$ driver...\n",stderr);
fputs("Please install xf86sup.sys in config.sys!\n",stderr);
return rc;
}
param = pid;
if ((rc=DosDevIOCtl(hfd, (ULONG)0x76, (ULONG)0x65,
(PULONG*)¶m,sizeof(USHORT),&plen,
NULL, 0, NULL)) != 0) {
fputs("ioctl failed for fastio$ driver\n",stderr);
DosClose(hfd);
return rc;
}
DosClose(hfd);
return 0;
}