|
|
1.1 root 1: /*static char *SCCSID = "@(#)bsedev.h 1.00 90/01/31";*/
2: /**************************************************************************\
3: *
4: * Module Name: BSEDEV.H
5: *
6: * OS/2 Structures and constants for use with DosDevIOCtl
7: *
8: * Copyright (c) 1989-1990, Microsoft Corporation. All rights reserved.
9: * Copyright (c) 1987-1990, IBM Corporation
10: *
11: \**************************************************************************/
12:
13: #define BSEDEV_INCLUDED
14:
15: /* Input and Output Control Categories */
16:
17: #define IOCTL_ASYNC 0x0001
18: #define IOCTL_SCR_AND_PTRDRAW 0x0003
19: #define IOCTL_KEYBOARD 0x0004
20: #define IOCTL_PRINTER 0x0005
21: #define IOCTL_LIGHTPEN 0x0006
22: #define IOCTL_POINTINGDEVICE 0x0007
23: #define IOCTL_DISK 0x0008
24: #define IOCTL_PHYSICALDISK 0x0009
25: #define IOCTL_MONITOR 0x000A
26: #define IOCTL_GENERAL 0x000B
27:
28: /* Serial-Device Control */
29:
30: #define ASYNC_SETBAUDRATE 0x0041
31: #define ASYNC_SETLINECTRL 0x0042
32: #define ASYNC_TRANSMITIMM 0x0044
33: #define ASYNC_SETBREAKOFF 0x0045
34: #define ASYNC_SETMODEMCTRL 0x0046
35: #define ASYNC_SETBREAKON 0x004B
36: #define ASYNC_STOPTRANSMIT 0x0047
37: #define ASYNC_STARTTRANSMIT 0x0048
38: #define ASYNC_SETDCBINFO 0x0053
39: #define ASYNC_GETBAUDRATE 0x0061
40: #define ASYNC_GETLINECTRL 0x0062
41: #define ASYNC_GETCOMMSTATUS 0x0064
42: #define ASYNC_GETLINESTATUS 0x0065
43: #define ASYNC_GETMODEMOUTPUT 0x0066
44: #define ASYNC_GETMODEMINPUT 0x0067
45: #define ASYNC_GETINQUECOUNT 0x0068
46: #define ASYNC_GETOUTQUECOUNT 0x0069
47: #define ASYNC_GETCOMMERROR 0x006D
48: #define ASYNC_GETCOMMEVENT 0x0072
49: #define ASYNC_GETDCBINFO 0x0073
50:
51: /* Screen/Pointer-Draw Control */
52:
53: #define SCR_ALLOCLDT 0x0070
54: #define SCR_DEALLOCLDT 0x0071
55: #define PTR_GETPTRDRAWADDRESS 0x0072
56: #define SCR_ALLOCLDTOFF 0x0075
57:
58: /* Keyboard Control */
59:
60: #define KBD_SETTRANSTABLE 0x0050
61: #define KBD_SETINPUTMODE 0x0051
62: #define KBD_SETINTERIMFLAG 0x0052
63: #define KBD_SETSHIFTSTATE 0x0053
64: #define KBD_SETTYPAMATICRATE 0x0054
65: #define KBD_SETFGNDSCREENGRP 0x0055
66: #define KBD_SETSESMGRHOTKEY 0x0056
67: #define KBD_SETFOCUS 0x0057
68: #define KBD_SETKCB 0x0058
69: #define KBD_SETNLS 0x005C
70: #define KBD_CREATE 0x005D
71: #define KBD_DESTROY 0x005E
72: #define KBD_GETINPUTMODE 0x0071
73: #define KBD_GETINTERIMFLAG 0x0072
74: #define KBD_GETSHIFTSTATE 0x0073
75: #define KBD_READCHAR 0x0074
76: #define KBD_PEEKCHAR 0x0075
77: #define KBD_GETSESMGRHOTKEY 0x0076
78: #define KBD_GETKEYBDTYPE 0x0077
79: #define KBD_GETCODEPAGEID 0x0078
80: #define KBD_XLATESCAN 0x0079
81:
82: /* Printer Control */
83:
84: #define PRT_SETFRAMECTL 0x0042
85: #define PRT_SETINFINITERETRY 0x0044
86: #define PRT_INITPRINTER 0x0046
87: #define PRT_ACTIVATEFONT 0x0048
88: #define PRT_GETFRAMECTL 0x0062
89: #define PRT_GETINFINITERETRY 0x0064
90: #define PRT_GETPRINTERSTATUS 0x0066
91: #define PRT_QUERYACTIVEFONT 0x0069
92: #define PRT_VERIFYFONT 0x006A
93:
94: /* Pointing-Device (Mouse) Control */
95:
96: #define MOU_ALLOWPTRDRAW 0x0050
97: #define MOU_UPDATEDISPLAYMODE 0x0051
98: #define MOU_SCREENSWITCH 0x0052
99: #define MOU_SETSCALEFACTORS 0x0053
100: #define MOU_SETEVENTMASK 0x0054
101: #define MOU_SETHOTKEYBUTTON 0x0055
102: #define MOU_SETPTRSHAPE 0x0056
103: #define MOU_DRAWPTR 0x0057
104: #define MOU_REMOVEPTR 0x0058
105: #define MOU_SETPTRPOS 0x0059
106: #define MOU_SETPROTDRAWADDRESS 0x005A
107: #define MOU_SETREALDRAWADDRESS 0x005B
108: #define MOU_SETMOUSTATUS 0x005C
109: #define MOU_DISPLAYMODECHANGE 0x005D
110: #define MOU_GETBUTTONCOUNT 0x0060
111: #define MOU_GETMICKEYCOUNT 0x0061
112: #define MOU_GETMOUSTATUS 0x0062
113: #define MOU_READEVENTQUE 0x0063
114: #define MOU_GETQUESTATUS 0x0064
115: #define MOU_GETEVENTMASK 0x0065
116: #define MOU_GETSCALEFACTORS 0x0066
117: #define MOU_GETPTRPOS 0x0067
118: #define MOU_GETPTRSHAPE 0x0068
119: #define MOU_GETHOTKEYBUTTON 0x0069
120: #define MOU_VER 0x006A
121:
122: /* Disk/Diskette Control */
123:
124: #define DSK_LOCKDRIVE 0x0000
125: #define DSK_UNLOCKDRIVE 0x0001
126: #define DSK_REDETERMINEMEDIA 0x0002
127: #define DSK_SETLOGICALMAP 0x0003
128: #define DSK_BLOCKREMOVABLE 0x0020
129: #define DSK_GETLOGICALMAP 0x0021
130: #define DSK_SETDEVICEPARAMS 0x0043
131: #define DSK_WRITETRACK 0x0044
132: #define DSK_FORMATVERIFY 0x0045
133: #define DSK_GETDEVICEPARAMS 0x0063
134: #define DSK_READTRACK 0x0064
135: #define DSK_VERIFYTRACK 0x0065
136:
137: /* Physical-Disk Control */
138:
139: #define PDSK_LOCKPHYSDRIVE 0x0000
140: #define PDSK_UNLOCKPHYSDRIVE 0x0001
141: #define PDSK_WRITEPHYSTRACK 0x0044
142: #define PDSK_GETPHYSDEVICEPARAMS 0x0063
143: #define PDSK_READPHYSTRACK 0x0064
144: #define PDSK_VERIFYPHYSTRACK 0x0065
145:
146: /* Character-Monitor Control */
147:
148: #define MON_REGISTERMONITOR 0x0040
149:
150: /* General Device Control */
151:
152: #define DEV_FLUSHINPUT 0x0001
153: #define DEV_FLUSHOUTPUT 0x0002
154: #define DEV_QUERYMONSUPPORT 0x0060
155:
156:
157: /* ASYNC_GETCOMMERROR, ASYNC_SETBREAKOFF, ASYNC_SETBREAKON,
158: * ASYNC_SETMODEMCTRL
159: */
160:
161: #define RX_QUE_OVERRUN 0x0001
162: #define RX_HARDWARE_OVERRUN 0x0002
163: #define PARITY_ERROR 0x0004
164: #define FRAMING_ERROR 0x0008
165:
166: /* ASYNC_GETCOMMEVENT */
167:
168: #define CHAR_RECEIVED 0x0001
169: #define LAST_CHAR_SENT 0x0004
170: #define CTS_CHANGED 0x0008
171: #define DSR_CHANGED 0x0010
172: #define DCD_CHANGED 0x0020
173: #define BREAK_DETECTED 0x0040
174: #define ERROR_OCCURRED 0x0080
175: #define RI_DETECTED 0x0100
176:
177: /* ASYNC_GETCOMMSTATUS */
178:
179: #define TX_WAITING_FOR_CTS 0x0001
180: #define TX_WAITING_FOR_DSR 0x0002
181: #define TX_WAITING_FOR_DCD 0x0004
182: #define TX_WAITING_FOR_XON 0x0008
183: #define TX_WAITING_TO_SEND_XON 0x0010
184: #define TX_WAITING_WHILE_BREAK_ON 0x0020
185: #define TX_WAITING_TO_SEND_IMM 0x0040
186: #define RX_WAITING_FOR_DSR 0x0080
187:
188: /* ASYNC_GETLINESTATUS */
189:
190: #define WRITE_REQUEST_QUEUED 0x0001
191: #define DATA_IN_TX_QUE 0x0002
192: #define HARDWARE_TRANSMITTING 0x0004
193: #define CHAR_READY_TO_SEND_IMM 0x0008
194: #define WAITING_TO_SEND_XON 0x0010
195: #define WAITING_TO_SEND_XOFF 0x0020
196:
197: /* ASYNC_GETMODEMINPUT */
198:
199: #define CTS_ON 0x10
200: #define DSR_ON 0x20
201: #define RI_ON 0x40
202: #define DCD_ON 0x80
203:
204: /* DSK_SETDEVICEPARAMS */
205:
206: #define BUILD_BPB_FROM_MEDIUM 0x00
207: #define REPLACE_BPB_FOR_DEVICE 0x01
208: #define REPLACE_BPB_FOR_MEDIUM 0x02
209:
210: /* KBD_GETINPUTMODE, KBD_PEEKCHAR, KBD_SETINPUTMODE*/
211:
212: #define ASCII_MODE 0x00
213: #define BINARY_MODE 0x80
214:
215: /* KBD_GETINTERIMFLAG */
216:
217: #define CONVERSION_REQUEST 0x20
218: #define INTERIM_CHAR 0x80
219:
220: /* KBD_GETSESMGRHOTKEY */
221:
222: #define HOTKEY_MAX_COUNT 0x0000
223: #define HOTKEY_CURRENT_COUNT 0x0001
224:
225: /* KBD_PEEKCHAR */
226:
227: #define KBD_DATA_RECEIVED 0x0001
228: #define KBD_DATA_BINARY 0x8000
229:
230: /* KBD_READCHAR */
231:
232: #define KBD_READ_WAIT 0x0000
233: #define KBD_READ_NOWAIT 0x8000
234:
235: /* KBD_SETINPUTMODE */
236:
237: #define SHIFT_REPORT_MODE 0x01
238:
239: #ifndef INCL_MOU
240:
241: #define MOUSE_MOTION 0x0001
242: #define MOUSE_MOTION_WITH_BN1_DOWN 0x0002
243: #define MOUSE_BN1_DOWN 0x0004
244: #define MOUSE_MOTION_WITH_BN2_DOWN 0x0008
245: #define MOUSE_BN2_DOWN 0x0010
246: #define MOUSE_MOTION_WITH_BN3_DOWN 0x0020
247: #define MOUSE_BN3_DOWN 0x0040
248:
249: #define MHK_BUTTON1 0x0001
250: #define MHK_BUTTON2 0x0002
251: #define MHK_BUTTON3 0x0004
252:
253: #define MOU_NOWAIT 0x0000
254: #define MOU_WAIT 0x0001
255:
256: #endif /* #ifndef INCL_MOU */
257:
258: /* MOU_GETHOTKEYBUTTON, MOU_SETHOTKEYBUTTON */
259:
260: #define MHK_NO_HOTKEY 0x0000
261:
262: /* MOU_GETMOUSTATUS */
263:
264: #define MOUSE_QUEUEBUSY 0x0001
265: #define MOUSE_BLOCKREAD 0x0002
266: #define MOUSE_FLUSH 0x0004
267: #define MOUSE_UNSUPPORTED_MODE 0x0008
268: #define MOUSE_DISABLED 0x0100
269: #define MOUSE_MICKEYS 0x0200
270:
271: /* PRT_GETPRINTERSTATUS */
272:
273: #define PRINTER_TIMEOUT 0x0001
274: #define PRINTER_IO_ERROR 0x0008
275: #define PRINTER_SELECTED 0x0010
276: #define PRINTER_OUT_OF_PAPER 0x0020
277: #define PRINTER_ACKNOWLEDGED 0x0040
278: #define PRINTER_NOT_BUSY 0x0080
279:
280: /* fbCtlHndShake */
281:
282: #define MODE_DTR_CONTROL 0x01
283: #define MODE_DTR_HANDSHAKE 0x02
284: #define MODE_CTS_HANDSHAKE 0x08
285: #define MODE_DSR_HANDSHAKE 0x10
286: #define MODE_DCD_HANDSHAKE 0x20
287: #define MODE_DSR_SENSITIVITY 0x40
288:
289: /* fbFlowReplace */
290:
291: #define MODE_AUTO_TRANSMIT 0x01
292: #define MODE_AUTO_RECEIVE 0x02
293: #define MODE_ERROR_CHAR 0x04
294: #define MODE_NULL_STRIPPING 0x08
295: #define MODE_BREAK_CHAR 0x10
296: #define MODE_RTS_CONTROL 0x40
297: #define MODE_RTS_HANDSHAKE 0x80
298: #define MODE_TRANSMIT_TOGGLE 0xC0
299:
300: /* fbTimeout */
301:
302: #define MODE_NO_WRITE_TIMEOUT 0x01
303: #define MODE_READ_TIMEOUT 0x02
304: #define MODE_WAIT_READ_TIMEOUT 0x04
305: #define MODE_NOWAIT_READ_TIMEOUT 0x06
306:
307: typedef struct _DCBINFO { /* dcbinf */
308: USHORT usWriteTimeout;
309: USHORT usReadTimeout;
310: BYTE fbCtlHndShake;
311: BYTE fbFlowReplace;
312: BYTE fbTimeout;
313: BYTE bErrorReplacementChar;
314: BYTE bBreakReplacementChar;
315: BYTE bXONChar;
316: BYTE bXOFFChar;
317: } DCBINFO;
318: typedef DCBINFO FAR *PDCBINFO;
319:
320: typedef struct _TRACKLAYOUT { /* trckl */
321: BYTE bCommand;
322: USHORT usHead;
323: USHORT usCylinder;
324: USHORT usFirstSector;
325: USHORT cSectors;
326: struct {
327: USHORT usSectorNumber;
328: USHORT usSectorSize;
329: } TrackTable[1];
330: } TRACKLAYOUT;
331: typedef TRACKLAYOUT FAR *PTRACKLAYOUT;
332:
333: #define DEVTYPE_48TPI 0x0000
334: #define DEVTYPE_96TPI 0x0001
335: #define DEVTYPE_35 0x0002
336: #define DEVTYPE_8SD 0x0003
337: #define DEVTYPE_8DD 0x0004
338: #define DEVTYPE_FIXED 0x0005
339: #define DEVTYPE_TAPE 0x0006
340: #define DEVTYPE_UNKNOWN 0x0007
341:
342: typedef struct _BIOSPARAMETERBLOCK { /* bspblk */
343: USHORT usBytesPerSector;
344: BYTE bSectorsPerCluster;
345: USHORT usReservedSectors;
346: BYTE cFATs;
347: USHORT cRootEntries;
348: USHORT cSectors;
349: BYTE bMedia;
350: USHORT usSectorsPerFAT;
351: USHORT usSectorsPerTrack;
352: USHORT cHeads;
353: ULONG cHiddenSectors;
354: ULONG cLargeSectors;
355: BYTE abReserved[6];
356: USHORT cCylinders;
357: BYTE bDeviceType;
358: USHORT fsDeviceAttr;
359: } BIOSPARAMETERBLOCK;
360: typedef BIOSPARAMETERBLOCK FAR *PBIOSPARAMETERBLOCK;
361:
362: typedef struct _SCREENGROUP { /* scrgrp */
363: USHORT idScreenGrp;
364: USHORT fTerminate;
365: } SCREENGROUP;
366: typedef SCREENGROUP FAR *PSCREENGROUP;
367:
368: typedef struct _FRAME { /* frm */
369: BYTE bCharsPerLine;
370: BYTE bLinesPerInch;
371: } FRAME;
372: typedef FRAME FAR *PFRAME;
373:
374: typedef struct _KBDTYPE { /* kbdtyp */
375: USHORT usType;
376: USHORT reserved1;
377: USHORT reserved2;
378: } KBDTYPE;
379: typedef KBDTYPE FAR *PKBDTYPE;
380:
381: typedef struct _LINECONTROL { /* lnctl */
382: BYTE bDataBits;
383: BYTE bParity;
384: BYTE bStopBits;
385: BYTE fTransBreak;
386: } LINECONTROL;
387: typedef LINECONTROL FAR *PLINECONTROL;
388:
389: /* MODEMSTATUS.fbModemOn, ASYNC_GETMODEMOUTPUT */
390:
391: #define DTR_ON 0x01
392: #define RTS_ON 0x02
393:
394: /* MODEMSTATUS.fbModemOff */
395:
396: #define DTR_OFF 0xFE
397: #define RTS_OFF 0xFD
398:
399: typedef struct _MODEMSTATUS { /* mdmst */
400: BYTE fbModemOn;
401: BYTE fbModemOff;
402: } MODEMSTATUS;
403: typedef MODEMSTATUS FAR *PMODEMSTATUS;
404:
405: typedef struct _TRACKFORMAT { /* trckfmt */
406: BYTE bCommand;
407: USHORT usHead;
408: USHORT usCylinder;
409: USHORT usReserved;
410: USHORT cSectors;
411: struct {
412: BYTE bCylinder;
413: BYTE bHead;
414: BYTE idSector;
415: BYTE bBytesSector;
416: } FormatTable[1];
417: } TRACKFORMAT;
418: typedef TRACKFORMAT FAR *PTRACKFORMAT;
419:
420: typedef struct _RXQUEUE { /* rxq */
421: USHORT cch;
422: USHORT cb;
423: } RXQUEUE;
424: typedef RXQUEUE FAR *PRXQUEUE;
425:
426: typedef struct _DEVICEPARAMETERBLOCK { /* dvpblck */
427: USHORT reserved1;
428: USHORT cCylinders;
429: USHORT cHeads;
430: USHORT cSectorsPerTrack;
431: USHORT reserved2;
432: USHORT reserved3;
433: USHORT reserved4;
434: USHORT reserved5;
435: } DEVICEPARAMETERBLOCK;
436: typedef DEVICEPARAMETERBLOCK FAR *PDEVICEPARAMETERBLOCK;
437:
438: typedef struct _PTRDRAWFUNCTION { /* ptrdfnc */
439: USHORT usReturnCode;
440: PFN pfnDraw;
441: PCH pchDataSeg;
442: } PTRDRAWFUNCTION;
443: typedef PTRDRAWFUNCTION FAR *PPTRDRAWFUNCTION;
444:
445: typedef struct _PTRDRAWADDRESS { /* ptrdaddr */
446: USHORT reserved;
447: PTRDRAWFUNCTION ptrdfnc;
448: } PTRDRAWADDRESS;
449: typedef PTRDRAWADDRESS FAR *PPTRDRAWADDRESS;
450:
451: typedef struct _SHIFTSTATE { /* shftst */
452: USHORT fsState;
453: BYTE fNLS;
454: } SHIFTSTATE;
455: typedef SHIFTSTATE FAR *PSHIFTSTATE;
456:
457: /* HOTKEY.fsHotKey/SHIFTSTATE.fsState */
458:
459: #define RIGHTSHIFT 0x0001
460: #define LEFTSHIFT 0x0002
461: #define CONTROL 0x0004
462: #define ALT 0x0008
463: #define SCROLLLOCK_ON 0x0010
464: #define NUMLOCK_ON 0x0020
465: #define CAPSLOCK_ON 0x0040
466: #define INSERT_ON 0x0080
467: #define LEFTCONTROL 0x0100
468: #define LEFTALT 0x0200
469: #define RIGHTCONTROL 0x0400
470: #define RIGHTALT 0x0800
471: #define SCROLLLOCK 0x1000
472: #define NUMLOCK 0x2000
473: #define CAPSLOCK 0x4000
474: #define SYSREQ 0x8000
475:
476: typedef struct _HOTKEY { /* htky */
477: USHORT fsHotKey;
478: UCHAR uchScancodeMake;
479: UCHAR uchScancodeBreak;
480: USHORT idHotKey;
481: } HOTKEY;
482: typedef HOTKEY FAR *PHOTKEY;
483:
484: typedef struct _MONITORPOSITION { /* mnpos */
485: USHORT fPosition;
486: USHORT index;
487: ULONG pbInBuf;
488: USHORT offOutBuf;
489: } MONITORPOSITION;
490: typedef MONITORPOSITION FAR *PMONITORPOSITION;
491:
492: typedef struct _RATEDELAY { /* rtdly */
493: USHORT usDelay;
494: USHORT usRate;
495: } RATEDELAY;
496: typedef RATEDELAY FAR *PRATEDELAY;
497:
498: typedef struct _CODEPAGEINFO { /* cpi */
499: PBYTE pbTransTable;
500: USHORT idCodePage;
501: USHORT idTable;
502: } CODEPAGEINFO;
503: typedef FAR *PCODEPAGEINFO;
504:
505: typedef struct _CPID { /* cpid */
506: USHORT idCodePage;
507: USHORT Reserved;
508: } CPID;
509: typedef FAR *PCPID;
510:
511: typedef struct _LDTADDRINFO { /* ldtaddr */
512: PULONG pulPhysAddr;
513: USHORT cb;
514: } LDTADDRINFO;
515: typedef FAR *PLDTADDRINFO;
516:
517: typedef struct _PTRDRAWDATA { /* ptrdd */
518: USHORT cb;
519: USHORT usConfig;
520: USHORT usFlag;
521: } PTRDRAWDATA;
522: typedef FAR *PPTRDRAWDATA;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.