1 | /*************************************************************************
|
---|
2 | *
|
---|
3 | * testprog.c - ring 3 test program for AHCI IDC function.
|
---|
4 | * This program opens the IDCTEST.SYS driver, which will call OS2AHCI's
|
---|
5 | * IDC entry point with a TEST IOCTL that does nothing but beep.
|
---|
6 | *
|
---|
7 | * Author: Markus Thielen, thi.guten Software Development.
|
---|
8 | *
|
---|
9 | * Compilation (Watcom): wcl386 -bt=os2 test.c
|
---|
10 | *
|
---|
11 | * Copyright (c) 2010 by thi.guten Software development, www.thiguten.de
|
---|
12 | *
|
---|
13 | * This program is free software; you can redistribute it and/or modify
|
---|
14 | * it under the terms of the GNU General Public License as published by
|
---|
15 | * the Free Software Foundation; either version 2 of the License, or
|
---|
16 | * (at your option) any later version.
|
---|
17 | *
|
---|
18 | * This program is distributed in the hope that it will be useful,
|
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
21 | * GNU General Public License for more details.
|
---|
22 | *
|
---|
23 | * You should have received a copy of the GNU General Public License
|
---|
24 | * along with this program; if not, write to the Free Software
|
---|
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
26 | */
|
---|
27 |
|
---|
28 | /*---- includes --------------------------------------------------------------*/
|
---|
29 |
|
---|
30 | #define INCL_DOSFILEMGR
|
---|
31 | #define INCL_DOSPROCESS
|
---|
32 | #define INCL_DOSERRORS
|
---|
33 | #include <os2.h>
|
---|
34 | #include <stdio.h>
|
---|
35 | #include <string.h>
|
---|
36 |
|
---|
37 |
|
---|
38 | /******************************************************************************
|
---|
39 | * main()
|
---|
40 | */
|
---|
41 | void main(void)
|
---|
42 | {
|
---|
43 | ULONG rc;
|
---|
44 | ULONG action;
|
---|
45 | HFILE hf;
|
---|
46 | char *drv_name = "IDCTEST$";
|
---|
47 |
|
---|
48 | printf("OS2AHCI IDC Test Program. Do you hear a beep??\n");
|
---|
49 | rc = DosOpen(drv_name, &hf, &action, 0,
|
---|
50 | FILE_NORMAL, FILE_OPEN, OPEN_SHARE_DENYNONE, NULL);
|
---|
51 | if (rc) {
|
---|
52 | /* open failed */
|
---|
53 | fprintf(stderr, "DosOpen failed with code %d ", rc);
|
---|
54 | fprintf(stderr, "Is IDCTEST.SYS really loaded?\n");
|
---|
55 | return;
|
---|
56 | }
|
---|
57 |
|
---|
58 | DosClose(hf);
|
---|
59 |
|
---|
60 | }
|
---|