//ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ
//Û                                                       Û
//Û      Virtual Pascal Runtime Library.  Version 2.1.    Û
//Û      OS/2 Base & Text Mode Applications API interface Û
//Û      ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÛ
//Û      Copyright (C) 1995-2000 vpascal.com              Û
//Û                                                       Û
//ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

unit Os2Base;

interface

{&Far16+,AlignRec-,OrgName+,Use32-}

uses Os2Def;

{----[ KBDCALLS ]----}

const
  kr_KbdCharIn                  = $00000001;    { KbdRegister FnMask }
  kr_KbdPeek                    = $00000002;
  kr_KbdFlushBuffer             = $00000004;
  kr_KbdGetStatus               = $00000008;
  kr_KbdSetStatus               = $00000010;
  kr_KbdStringIn                = $00000020;
  kr_KbdOpen                    = $00000040;
  kr_KbdClose                   = $00000080;
  kr_KbdGetFocus                = $00000100;
  kr_KbdFreeFocus               = $00000200;
  kr_KbdGetCp                   = $00000400;
  kr_KbdSetCp                   = $00000800;
  kr_KbdXlate                   = $00001000;
  kr_KbdSetCustXt               = $00002000;

  io_Wait                       = 0;            { WaitFlag           }
  io_NoWait                     = 1;

  keyboard_Echo_On              = $0001;        { KBDINFO.fsMask     }
  keyboard_Echo_Off             = $0002;
  keyboard_Binary_Mode          = $0004;
  keyboard_Ascii_Mode           = $0008;
  keyboard_Modify_State         = $0010;
  keyboard_Modify_Interim       = $0020;
  keyboard_Modify_Turnaround    = $0040;
  keyboard_2B_Turnaround        = $0080;
  keyboard_Shift_Report         = $0100;

  kbdstf_RightShift             = $0001;        { KBDINFO.fsState    }
  kbdstf_LeftShift              = $0002;        { KBDKEYINFO.fsState }
  kbdstf_Control                = $0004;        { KBDTRANS.fsState   }
  kbdstf_Alt                    = $0008;
  kbdstf_ScrollLock_On          = $0010;
  kbdstf_NumLock_On             = $0020;
  kbdstf_Capslock_On            = $0040;
  kbdstf_Insert_On              = $0080;
  kbdstf_LeftControl            = $0100;
  kbdstf_LeftAlt                = $0200;
  kbdstf_RightControl           = $0400;
  kbdstf_RightAlt               = $0800;
  kbdstf_ScrollLock             = $1000;
  kbdstf_NumLock                = $2000;
  kbdstf_CapsLock               = $4000;
  kbdstf_SysReq                 = $8000;

  kbdtrf_Shift_Key_In           = $01;          { KBDTRANS.fbStatus  }
  kbdtrf_Conversion_Request     = $20;
  kbdtrf_Final_Char_In          = $40;
  kbdtrf_Interim_Char_In        = $80;

  keyboard_At_Compatible        = $0001;        { KbdHwId.IdKbd      }
  keyboard_Enhanced_101         = $AB41;
  keyboard_Enhanced_102         = $AB41;
  keyboard_Enhanced_122         = $AB85;
  keyboard_SpaceSaver           = $AB54;

type
  KbdKeyInfo = record           { Record for KbdCharIn and KbdPeek          }
    chChar:     Char;           { ASCII char (0 or $E0 = extended ASCII)    }
    chScan:     Byte;           { Scan code (or extended ASCII char)        }
    fbStatus:   Byte;           { Miscellaneous status; key recieved flag   }
    bNlsShift:  Byte;           { NLS Shift Status                          }
    fsState:    SmallWord;      { State of shift keys                       }
    time:       ULong;          { TimeStamp (unique number of milliseconds) }
  end;

  StringInBuf = record          { Record for KbdStringIn                    }
    cb:         SmallWord;      { Requested maximum number of characters    }
    cchIn:      SmallWord;      { Expects: size of previous input(template) }
  end;                          { Returns: the actual number of characters  }

  KbdInfo = record              { record for KbdSet / GetStatus             }
    cb:           SmallWord;    { Size of this record                       }
    fsMask:       SmallWord;    { Mode of operation                         }
    chTurnAround: SmallWord;    { usually $000D; i.e. Enter                 }
    fsInterim:    SmallWord;    { NLS control bits                          }
    fsState:      SmallWord;    { Shift key status                          }
  end;

  KbdHwId = record              { record for KbdGetHWID                     }
    cb:          SmallWord;     { Size of this record                       }
    idKbd:       SmallWord;     { Id number generated by keyboard hardware  }
    usReserved1: SmallWord;     { Reserved                                  }
    usReserved2: SmallWord;     { Reserved                                  }
  end;

  KbdTrans = record             { record for KbdXlate                       }
    chChar:     Char;           { Returns: ASCII Char(0 for X-ASCII)        }
    chScan:     Byte;           { Expects: Scan Code; Returns: 0 (or X-ASCII) }
    fbStatus:   Byte;           { Indicates return status                   }
    bNlsShift:  Byte;           { NLS shift status                          }
    fsState:    SmallWord;      { Shift key status                          }
    time:       ULong;          { TimeStamp (unique number of milliseconds  }
    fsDD:       SmallWord;      { Device driver returned flags              }
    fsXlate:    SmallWord;      { Different flags (translation complete flag) }
    fsShift:    SmallWord;      { Used in multi-key keystroke translation   }
    sZero:      SmallWord;      { Reserved, must be zero                    }
  end;

function KBDCHARIN(var Key: KbdKeyInfo; WaitFlag: SmallWord; KbdHandle: SmallWord): ApiRet16;
function KBDCLOSE(KbdHandle: SmallWord): ApiRet16;
function KBDDEREGISTER: ApiRet16;
function KBDFLUSHBUFFER(KbdHandle: SmallWord): ApiRet16;
function KBDFREEFOCUS(KbdHandle: SmallWord): ApiRet16;
function KBDGETCP(Reserved: ULong; var CodePage: SmallWord; KbdHandle: SmallWord): ApiRet16;
function KBDGETFOCUS(WaitFlag: SmallWord; KbdHandle: SmallWord): ApiRet16;
function KBDGETHWID(var HwId: KbdHwId; KbdHandle: SmallWord): ApiRet16;
function KBDGETSTATUS(var Status: KbdInfo; KbdHandle: SmallWord): ApiRet16;
function KBDOPEN(var KbdHandle: SmallWord): ApiRet16;
function KBDPEEK(var Key: KbdKeyInfo; KbdHandle: SmallWord): ApiRet16;
function KBDREGISTER(ModuleName,ProcName: PChar; FnMask: ULong): ApiRet16;
function KBDSETCP(usReserved: SmallWord; CodePage: SmallWord; KbdHandle: SmallWord): ApiRet16;
function KBDSETCUSTXT(XLateTbl: Pointer; KbdHandle: SmallWord): ApiRet16;
function KBDSETFGND: ApiRet16;
function KBDSETHWID(var HwId: KbdHwId; KbdHandle: SmallWord): ApiRet16;
function KBDSETSTATUS(var Status: KbdInfo; KbdHandle: SmallWord): ApiRet16;
function KBDSTRINGIN(CharBuf: Pointer; var LenInOut: StringInBuf; WaitFlag: SmallWord; KbdHandle: SmallWord): ApiRet16;
function KBDSYNCH(WaitFlag: SmallWord): ApiRet16;
function KBDXLATE(var TransData: KbdTrans; KbdHandle: SmallWord): ApiRet16;

{----[ MOUCALLS ]----}

const
  mr_MouGetNumButtons           = $00000001;    { MouRegsiter FnMask }
  mr_MouGetNumMickeys           = $00000002;
  mr_MouGetDevStatus            = $00000004;
  mr_MouGetNumQueEl             = $00000008;
  mr_MouReadEventQue            = $00000010;
  mr_MouGetScaleFact            = $00000020;
  mr_MouGetEventMask            = $00000040;
  mr_MouSetScaleFact            = $00000080;
  mr_MouSetEventMask            = $00000100;
  mr_MouOpen                    = $00000800;
  mr_MouClose                   = $00001000;
  mr_MouGetPtrShape             = $00002000;
  mr_MouSetPtrShape             = $00004000;
  mr_MouDrawPtr                 = $00008000;
  mr_MouRemovePtr               = $00010000;
  mr_MouGetPtrPos               = $00020000;
  mr_MouSetPtrPos               = $00040000;
  mr_MouInitReal                = $00080000;
  mr_MouSetDevStatus            = $00100000;

  mhk_Button1                   = $0001;        { MouGetHotKey / MouSetHotKey }
  mhk_Button2                   = $0002;        { Mouse Hot Key bits          }
  mhk_Button3                   = $0004;

  mouse_QueueBusy               = $0001;        { MouGetDevStatus /           }
  mouse_BlockRead               = $0002;        { MouSetDevStatus             }
  mouse_Flush                   = $0004;        { device status constants     }
  mouse_Unsupported_Mode        = $0008;
  mouse_Disabled                = $0100;
  mouse_Mickeys                 = $0200;

  mou_NoWait                    = $0000;        { WaitFlag                    }
  mou_Wait                      = $0001;

  mouse_Motion                  = $0001;        { MouGetEventMask /           }
  mouse_Motion_With_Bn1_Down    = $0002;        { MouSetEventMask events      }
  mouse_Bn1_Down                = $0004;
  mouse_Motion_With_Bn2_Down    = $0008;
  mouse_Bn2_Down                = $0010;
  mouse_Motion_With_Bn3_Down    = $0020;
  mouse_Bn3_Down                = $0040;

  mou_NoDraw                    = $0001;        { MouSetDevStatus Status      }
  mou_Draw                      = $0000;
  mou_Mickeys                   = $0002;
  mou_Pels                      = $0000;

type
  PtrLoc = record               { Record for MouGet / SetPtrPos               }
    Row:        SmallWord;      { Current row (vertical coordinate)           }
    Col:        SmallWord;      { Current column (horizontal coordinate)      }
  end;

  PtrShape = record             { Record for MouGetPtrShape / MouSetPtrShape  }
    cb:         SmallWord;      { Length of image buffer in bytes             }
    Col:        SmallWord;      { Pointer width in characters or pixels       }
    Row:        SmallWord;      { Pointer height in characters or pixels      }
    ColHot:     SmallWord;      { Hotspot offset from left side               }
    RowHot:     SmallWord;      { Hotspot offset from top                     }
  end;

  MouEventInfo = record         { Record for MouReadEventQue                  }
    fs:         SmallWord;      { Event bits                                  }
    Time:       ULong;          { Event timestamp (unique number of milliseconds)}
    Row:        SmallWord;      { Pointer current row position                }
    Col:        SmallWord;      { Pointer current column position             }
  end;

  MouQueInfo = record           { Record for MouGetNumQueEl                   }
    cEvents:    SmallWord;      { Number of elements in event queue           }
    cMaxEvents: SmallWord;      { Maximum queue size in elements              }
  end;

  ScaleFact = record            { Record for MouGetScaleFact / MouSetScaleFact}
    RowScale:   SmallWord;      { Scaling factor of current row               }
    ColScale:   SmallWord;      { Scaling factor of current column            }
  end;

  NoPtrRect = record            { Record for MouRemovePtr                     }
    Row:        SmallWord;      { Row of top of the rectangle                 }
    Col:        SmallWord;      { Column of left edge of the rectangle        }
    cRow:       SmallWord;      { Row of bottom right edge of the rectangle   }
    cCol:       SmallWord;      { Column of botton right edge of the rectangle}
  end;

  Threshold = record            { Record for MouGetThreshold / MouSetThreshold}
    Length:     SmallWord;      { Length Field                                }
    Level1:     SmallWord;      { First movement level                        }
    Lev1Mult:   SmallWord;      { First level multiplier                      }
    Level2:     SmallWord;      { Second movement level                       }
    Lev2Mult:   SmallWord;      { Second level multiplier                     }
  end;

function MOUCLOSE(MouHandle: SmallWord): ApiRet16;
function MOUDEREGISter: ApiRet16;
function MOUDRAWPTR(MouHandle: SmallWord): ApiRet16;
function MOUFLUSHQUE(MouHandle: SmallWord): ApiRet16;
function MOUGETDEVSTATUS(var Status: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUGETEVENTMASK(var EventMask: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUGETHOTKEY(var ButtonBits: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUGETNUMBUTTONS(var ButtonCount: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUGETNUMMICKEYS(var MickeyCnt: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUGETNUMQUEEL(var MouseQInfo: MouQueInfo; MouHandle: SmallWord): ApiRet16;
function MOUGETPTRPOS(var MouPtr: PtrLoc; MouHandle: SmallWord): ApiRet16;
function MOUGETPTRSHAPE(ImageBuf: Pointer; var ImageInfo: PtrShape; MouHandle: SmallWord): ApiRet16;
function MOUGETSCALEFACT(var Scale: ScaleFact; MouHandle: SmallWord): ApiRet16;
function MOUGETTHRESHOLD(var MouThreshold: Threshold; MouHandle: SmallWord): ApiRet16;
function MOUINITREAL(DriverName: PChar): ApiRet16;
function MOUOPEN(DriverName: PChar; var MouHandle: SmallWord): ApiRet16;
function MOUREADEVENTQUE(var Event: MouEventInfo; var WaitFlag: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUREGISTER(ModuleName,ProcName: PChar; FnMask: ULong): ApiRet16;
function MOUREMOVEPTR(var ProtectArea: NoPtrRect; MouHandle: SmallWord): ApiRet16;
function MOUSETDEVSTATUS(var Status: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUSETEVENTMASK (var EventMask: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUSETHOTKEY(var ButtonBits: SmallWord; MouHandle: SmallWord): ApiRet16;
function MOUSETPTRPOS (var MouPtr: PtrLoc; MouHandle: SmallWord): ApiRet16;
function MOUSETPTRSHAPE(ImageBuf: Pointer; var ImageInfo: PtrShape; MouHandle: SmallWord): ApiRet16;
function MOUSETSCALEFACT (var Scale: ScaleFact; MouHandle: SmallWord): ApiRet16;
function MOUSETTHRESHOLD(var MouThreshold: Threshold; MouHandle: SmallWord): ApiRet16;
function MOUSYNCH(WaitFlag: SmallWord): ApiRet16;

{----[ VIOCALLS ]----}

const
  vr_VioGetCurPos               = $00000001;    { First parameter registration }
  vr_VioGetCurType              = $00000002;    { constants                    }
  vr_VioGetMode                 = $00000004;
  vr_VioGetBuf                  = $00000008;
  vr_VioGetPhysBuf              = $00000010;
  vr_VioSetCurPos               = $00000020;
  vr_VioSetCurType              = $00000040;
  vr_VioSetMode                 = $00000080;
  vr_VioShowBuf                 = $00000100;
  vr_VioReadCharStr             = $00000200;
  vr_VioReadCellStr             = $00000400;
  vr_VioWrtNChar                = $00000800;
  vr_VioWrtNAttr                = $00001000;
  vr_VioWrtNCell                = $00002000;
  vr_VioWrtTTy                  = $00004000;
  vr_VioWrtCharStr              = $00008000;
  vr_VioWrtCharStrAtt           = $00010000;
  vr_VioWrtCellStr              = $00020000;
  vr_VioScrollUp                = $00040000;
  vr_VioScrollDn                = $00080000;
  vr_VioScrollLf                = $00100000;
  vr_VioScrollRt                = $00200000;
  vr_VioSetAnsi                 = $00400000;
  vr_VioGetAnsi                 = $00800000;
  vr_VioPrtSc                   = $01000000;
  vr_VioScrLock                 = $02000000;
  vr_VioScrUnlock               = $04000000;
  vr_VioSavRedrawWait           = $08000000;
  vr_VioSavRedrawUndo           = $10000000;
  vr_VioPopup                   = $20000000;
  vr_VioEndPopup                = $40000000;
  vr_VioPrtScToggle             = $80000000;

  vr_VioModeWait                = $00000001;    { Second parameter registration}
  vr_VioModeUndo                = $00000002;    { constants                    }
  vr_VioGetFont                 = $00000004;
  vr_VioGetConfig               = $00000008;
  vr_VioSetCp                   = $00000010;
  vr_VioGetCp                   = $00000020;
  vr_VioSetFont                 = $00000040;
  vr_VioGetState                = $00000080;
  vr_VioSetState                = $00000100;

  colors_2                      = $0001;        { VioModeInfo.Color constants }
  colors_4                      = $0002;
  colors_16                     = $0004;
  colors_256                    = $0008;

  vgmt_Other                    = $01;          { VioModeInfo.fbType          }
  vgmt_Graphics                 = $02;
  vgmt_DisableBurst             = $04;

  vcc_SbCsChar                  = 0;            { VioCheckCharType.pType      }
  vcc_DbCsFullChar              = 1;
  vcc_DbCs1stHalf               = 2;
  vcc_DbCs2ndHalf               = 3;

  ansi_On                       = 1;            { VioGetAnsi / VioSetAnsi Mode}
  ansi_Off                      = 0;

  vsrwi_SaveAndRedraw           = 0;            { VioSavRedrawWait RequestType}
  vsrwi_Redraw                  = 1;
  vsrwn_Save                    = 0;            { VioSavRedrawWait NotifyType }
  vsrwn_Redraw                  = 1;

  undoi_GetOwner                = 0;            { VioSavRedrawUndo Ownership  }
  undoi_ReleaseOwner            = 1;
  undok_ErrorCode               = 0;            { VioSavRedrawUndo KillThread }
  undok_Terminate               = 1;

  vmwr_Popup                    = 0;            { VioModeWait RequestType     }
  vmwn_Popup                    = 0;            { VioModeWait NotifyType      }

  lockIO_NoWait                 = 0;            { VioScrLock WaitFlag         }
  lockIO_Wait                   = 1;
  lock_Success                  = 0;            { VioScrLock Status           }
  lock_Fail                     = 1;

  vp_NoWait                     = $0000;        { VioPopup OptionFlags        }
  vp_Wait                       = $0001;
  vp_Opaque                     = $0000;
  vp_Transparent                = $0002;

  vio_Config_Current            = 0;            { VioGetConfig.Configuration  }
  vio_Config_Primary            = 1;
  vio_Config_Secondary          = 2;

  display_Monochrome            = $0000;        { VioConfigInfo.Adapter       }
  display_CGA                   = $0001;
  display_EGA                   = $0002;
  display_VGA                   = $0003;
  display_8514a                 = $0007;

  monitor_Monochrome            = $0000;        { VioConfigInfo.Display       }
  monitor_Color                 = $0001;
  monitor_Enhanced              = $0002;
  monitor_8503                  = $0003;
  monitor_851x_Color            = $0004;
  monitor_8514                  = $0009;

  vgfi_GetCurFont               = 0;            { VioFontInfo.Type            }
  vgfi_GetROMFont               = 1;

type
  VioCursorInfo = record        { Record for VioSetCurType / VioGetCurType    }
    yStart:     SmallWord;      { Cursor start scan line (0-based)            }
    cEnd:       SmallWord;      { Cursor end scan line                        }
    cx:         SmallWord;      { Cursor width (0=default width)              }
    Attr:       SmallWord;      { Cursor color attribute (-1 = hidden)        }
  end;

  VioModeInfo = record          { Record for VioSetMode / VioGetMode          }
    cb:         SmallWord;      { Size of this structure                      }
    fbType:     Byte;           { 8-bit mask identifying the mode             }
    Color:      Byte;           { Colors available. Power of 2 (1=2,2=4,4=16) }
    Col:        SmallWord;      { Number of text character columns            }
    Row:        SmallWord;      { Number of text character rows               }
    HRes:       SmallWord;      { Display width in pixels                     }
    VRes:       SmallWord;      { Display height in pixels                    }
    fmt_ID:     Byte;           { Format of the attributes                    }
    Attrib:     Byte;           { Number of attributes in the attribfmt field }
    Buf_Addr:   ULong;          { Address of the physical display buffer      }
    Buf_Length: ULong;          { Length of the physical display buffer       }
    Full_Length: ULong;         { Size of the buffer to save entire phis. buf.}
    Partial_Length: ULong;      { Size of the buffer to save part of the phis. buf. overwritten by VioPopup }
    Ext_Data_Addr: Pointer;     { Address of an extended-mode structure       }
  end;

  VioPhysBuf = record           { Record for VioGetPhysBuf                    }
    pBuf:       Pointer;        { Absolute screen address                     }
    cb:         ULong;          { Length of the buffer in bytes               }
    Sel:        SmallWord;      { Receives selector for video access          }
  end;

  VioConfigInfo = record        { Record for VioGetConfig                     }
    cb:         SmallWord;      { Size of this structure                      }
    Adapter:    SmallWord;      { Adapter type                                }
    Display:    SmallWord;      { Display type                                }
    cbMemory:   ULong;          { Amount of RAM in bytes on the adapter       }
    Configuration: SmallWord;   { Configuration Id (Primary,Secondary,Current)}
    VDHVersion: SmallWord;      { Reserved; must be zero                      }
    Flags:      SmallWord;      { Flags: $0001 sets default power-on config   }
    HWBufferSize: ULong;        { Size of the buffer to save full adapter state(not including phis buf)}
    FullSaveSize: ULong;        { Size of the buffer to save entire adapter state}
    PartSaveSize: ULong;        { Size of the buffer to save part of the phis. buf. overwritten by VioPopup }
    EMAdaptersOFF: SmallWord;   { Offset of the info that describes emulated adapter types}
    EMDisplaysOFF: SmallWord;   { Offset of the info that describes emulated display types}
  end;

  VioFontInfo = record          { Record for VioGetFont / VioSetFont          }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { Request type                                }
    cxCell:     SmallWord;      { Column per cell                             }
    cyCell:     SmallWord;      { Rows per cell                               }
    pbData:     Pointer;        { Address of caller's data area               }
    cbData:     SmallWord;      { Size in bytes of the callers data area      }
  end;

  VioPalState = record          { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 0 = palette                                 }
    iFirst:     SmallWord;      { Specifies the first register                }
    Acolor:     array [0..15] of SmallWord; { Up to 16 register values             }
  end;

  VioOverScan = record          { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 1 = border color                            }
    Color:      SmallWord;      { The color of the border area                }
  end;

  VioIntensity = record         { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 2 = Blink/bold settings                     }
    fs:         SmallWord;      { The blink/bold background switch            }
  end;

  VioColorReg = record          { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 3 = Color registers                         }
    FirstColorReg: SmallWord;   { Specifies the first color registers         }
    NumColorRegs: SmallWord;    { Number of color registers                   }
    ColorRegAddr: Pointer;      { Pointer to array with color values          }
  end;

  VioSetULineLoc = record       { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 5 = Underline                               }
    ScanLine:   SmallWord;      { Location of the underline (32=no underline) }
  end;

  VioSetTarget = record         { Record for VioGetState / VioSetState        }
    cb:         SmallWord;      { Size of this structure                      }
    rType:      SmallWord;      { 6 = Target for VioSetMode                   }
    DefaultAlgorithm: SmallWord;{ $0000=default, $0001=Primary, $0002=Secondary}
  end;

function VIOCHECKCHARTYPE(var CharType: SmallWord; Row,Column,VioHandle: SmallWord): ApiRet16;
function VIODEREGISTer: ApiRet16;
function VIOENDPOPUP(VioHandle: SmallWord): ApiRet16;
function VIOGETANSI(var Mode: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOGETBUF(var LVBAddr: Pointer; var LVBLength: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOGETCONFIG(ConfigId: SmallWord; var VideoConfig: VioConfigInfo; VioHandle: SmallWord): ApiRet16;
function VIOGETCP(Reserved: SmallWord; var CodePage: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOGETCURPOS(var Row,Col: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOGETCURTYPE(var CurData: VioCursorInfo; VioHandle: SmallWord): ApiRet16;
function VIOGETFONT(var FontData: VioFontInfo; VioHandle: SmallWord): ApiRet16;
function VIOGETMODE(var Mode: VioModeInfo; VioHandle: SmallWord): ApiRet16;
function VIOGETPHYSBUF(var PBData: VioPhysBuf; Reserved: SmallWord): ApiRet16;
function VIOGETSTATE(var State; VioHandle: SmallWord): ApiRet16;
function VIOMODEUNDO(OwnerShip,KillFlag,Reserved: SmallWord): ApiRet16;
function VIOMODEWAIT(RequestType: SmallWord; var NotifyType: SmallWord; Reserved: SmallWord): ApiRet16;
function VIOPOPUP(var OptionFlags: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOPRTSC(VioHandle: SmallWord): ApiRet16;
function VIOPRTSCTOGGLE(VioHandle: SmallWord): ApiRet16;
function VIOREADCELLSTR(var Buf; var BufLen: SmallWord; Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOREADCHARSTR(var Buf; var BufLen: SmallWord; Row,Column,VioHandle: SmallWord): ApiRet16;
{ Stealth function: it's declared in the C header file, but it's not }
{ available in the VIOCALLS dynamic link library                     }
{function VioRedrawSize(var RedrawSize: ULong): ApiRet16;            }
function VIOREGISTER(ModuleName,ProcName: PChar; FnMask1,FnMask2: ULong): ApiRet16;
function VIOSAVREDRAWUNDO(Ownership,KillThread,Reserved: SmallWord): ApiRet16;
function VIOSAVREDRAWWAIT(RequestType: SmallWord; var NotifyType: SmallWord; Reserved: SmallWord): ApiRet16;
function VIOSCRLOCK(WaitFlag: SmallWord; var Status: Byte; VioHandle: SmallWord): ApiRet16;
function VIOSCRUNLOCK(VioHandle: SmallWord): ApiRet16;
function VIOSCROLLDN(TopRow,LeftCol,BotRow,RightCol,Lines: SmallWord; var Cell: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSCROLLLF(TopRow,LeftCol,BotRow,RightCol,cbCol: SmallWord; var Cell: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSCROLLRT(TopRow,LeftCol,BotRow,RightCol,cbCol: SmallWord; var Cell: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSCROLLUP(TopRow,LeftCol,BotRow,RightCol,Lines: SmallWord; var Cell: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSETANSI(Mode,VioHandle: SmallWord): ApiRet16;
function VIOSETCP(Reserved: SmallWord; CodePage: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSETCURPOS(Row,Column: SmallWord; VioHandle: SmallWord): ApiRet16;
function VIOSETCURTYPE(var CurData: VioCursorInfo; VioHandle: SmallWord): ApiRet16;
function VIOSETFONT(var FontData: VioFontInfo; VioHandle: SmallWord): ApiRet16;
function VIOSETMODE(var Mode: VioModeInfo; VioHandle: SmallWord): ApiRet16;
function VIOSETSTATE(var State; VioHandle: SmallWord): ApiRet16;
function VIOSHOWBUF(BufOfs,Len,VioHandle: SmallWord): ApiRet16;
function VIOWRTCELLSTR(CellStr: Pointer; Len,Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOWRTCHARSTR(CharStr: Pointer; Len,Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOWRTCHARSTRATT(CharStr: Pointer; Len,Row,Column: SmallWord; var Attr: Byte; VioHandle: SmallWord): ApiRet16;
function VIOWRTNATTR(var Attr: Byte; Times,Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOWRTNCELL(var Cell: SmallWord; Times,Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOWRTNCHAR(var Char: Byte; Times,Row,Column,VioHandle: SmallWord): ApiRet16;
function VIOWRTTTY(CharStr: Pointer; Len,VioHandle: SmallWord): ApiRet16;

{----[ MONCALLS ]----}

const
  monitor_Default               = $0000;        { DosMonReg PosCode           }
  monitor_Begin                 = $0001;
  monitor_End                   = $0002;

type
  MonIn = record                { Record for DosMonRead / DosMonReg           }
    cb:       SmallWord;        { Size of this structure                      }
    Reserved: array [0..17] of Byte;    { Reserved                            }
    Buffer:   array [0..107] of Byte;   { Input buffer                        }
  end;

  MonOut = record               { Record for DosMonWrite / DosMonReg          }
    cb:       SmallWord;        { Size of this structure                      }
    Reserved: array [0..17] of Byte;    { Reserved                            }
    Buffer:   array [0..107] of Byte;   { Output buffer                       }
  end;

function DOSMONCLOSE(MonHandle: SmallWord): ApiRet16;
function DOSMONOPEN(DevName: PChar; var MonHandle: SmallWord): ApiRet16;
function DOSMONREAD(InBuf: Pointer; WaitFlag: SmallWord; DataBuf: Pointer; var BytesRead: SmallWord): ApiRet16;
function DOSMONREG(MonHandle: SmallWord; InBuf,OutBuf: Pointer; PosCode,Index: SmallWord): ApiRet16;
function DOSMONWRITE(OutBuf,DataBuf: Pointer; ByteCount: SmallWord): ApiRet16;

{----[ BDCALLS ]----}

{ BidiHotKeys in BIDISTRUCT                                                }
{ The following defined value may be used to Enable/Disable the Bidi       }
{ keyboard hot keys.                                                       }
{ To enable a hot key, perform an 'OR' operation on the Bidi hot key flag  }
{ Word in the KBVCBTYPE  structure with the required defined value.        }
{ To disable a hot key, perform an 'AND NOT' operation on the Bidi hot key }
{ flag Word in the KBVCBTYPE  structure with the required defined value.   }
const
  bdhkflag_Push                 = $0004;
  bdhkflag_End_Push             = $0008;
  bdhkflag_Auto_Push            = $0010;
  bdhkflag_Field_Rev            = $0020;
  bdhkflag_Screen_Rev           = $0040;
  bdhkflag_Bidi_Popup           = $0200;
  bdhkflag_Automatic            = $0400;
  bdhkflag_Initial              = $0800;
  bdhkflag_Middle               = $1000;
  bdhkflag_Final                = $2000;
  bdhkflag_Isolated             = $4000;
{ Bidi Flags in BIDISTRUCT                                                 }
{ The following defined value may be used to Enable/Disable the Bidi       }
{ functions.                                                               }
{ To enable a Bidi function, perform an 'OR' operation on the Bidi flags   }
{ Word in the BDKBVCB  structure with the required defined value.          }
{ To disable a Bidi fuction, perform an 'AND NOT' operation on the Bidi    }
{ flags Word in the BDKBVCB  structure with the required defined value.    }
  bdflag_AutoPush_Rtl           = $0001;
  bdflag_AutoPush_Ltr           = $0002;
  bdflag_PushLevel              = $0004;
  bdflag_Layer                  = $0010;
  bdflag_Field_Rev              = $0020;
{ CSD in BIDIATT                                                           }
{ The following defined value may be used to select the specified          }
{ bit in the Bidi Attributes.                                              }
  bdcsd_Automatic               = $00000000;
  bdcsd_PassThru                = $00000001;
  bdcsd_Base                    = $00000010;
  bdcsd_Initial                 = $00000011;
  bdcsd_Middle                  = $00000012;
  bdcsd_Final                   = $00000013;
  bdcsd_Isolated                = $00000014;
  bdnum_Arabic                  = $00000000;
  bdnum_PassThru                = $00001000;
  bdnum_Hindu                   = $00002000;
  bdorient_Ltr                  = $00000000;
  bdorient_Rtl                  = $00010000;
  bd_Level                      = $30000000;
  bd_Support                    = $00000000;

{ The keyboard control block structure }
type
  BdKvCb = record
    BDLength:      SmallWord;
    BDVersionId:   SmallWord;
    BDAtts:        ULong;
    Reserved:      ULong;
    BDHotKeyFlags: SmallWord;
    BDFlags:       SmallWord;
    Reserved2:     array [0..63] of Byte;
  end;

{ The printer control block structure }
  BdPrCb = record
    PRLength: SmallWord;
    PRAtts:   ULong;
    Reserved: array [0..13] of Byte;
  end;

{ The Character Shape Determination structure }

  PCSDRec = ^CSDRec;
  CSDRec = record
    RecLength:    ULong;
    Buffer:       Pointer;
    BufferLength: ULong;
    BufferIndex:  ULong;
  end;

  PRetInfo = Pointer;
  PSetInfo = Pointer;

function NLSQUERYBIDIATT(Effect: Long; RetInfo: PRetInfo): ApiRet16;
function NLSSETBIDIATT(Effect: Long; SetInfo: PSetInfo): ApiRet16;
function NLSSHAPEBIDISTRING(BidiAtts,Reserved: ULong; Src,Target: PChar; Length,Increment: ULong): ApiRet16;
function NLSEDITSHAPE(BidiAtts: ULong; Effect: Long; var Src,Target: CSDRec; var CSDState: ULong; Increment: ULong): ApiRet16;
function NLSINVERSESTRING(Src,Target: PChar; Length,Increment: ULong): ApiRet16;
function NLSCONVERTBIDINUMERICS(BidiAtts: ULong; Reserved: Long; Src,Tagret: PChar; Length,Increment: ULong): ApiRet16;
function NLSSETBIDIPRINT(BidiAtts,Length: ULong; FileHandle: SmallWord): ApiRet16;
function NLSCONVERTBIDISTRING(Src,Target: PChar; Length,Increment,SBidiAtts,TBidiAtts,Reserved: ULong): ApiRet16;

{----[ DOSCALLS ]----}

{$Cdecl+}

{ General services }
function DosBeep(Freq,Dur: Longint): ApiRet;

{ Process and Thread support }
function DosExit(Action,Result: Longint): ApiRet;

{ DosExit codes }
const
  exit_Thread                   = 0;
  exit_Process                  = 1;

type
  FnThread  = function(P: ULong): ApiRet;

  PTib2 = ^Tib2;                        { Thread Information Block (TIB)      }
  Tib2  = record                        { System specific portion             }
    Tib2_ulTid:           ULong;        { Thread I.D.                         }
    Tib2_ulPri:           ULong;        { Thread priority                     }
    Tib2_Version:         ULong;        { Version number for this structure   }
    Tib2_usMCCount:       SmallWord;    { Must Complete count                 }
    Tib2_fMCForceFlag:    SmallWord;    { Must Complete force flag            }
  end;

  PTib = ^Tib;
  Tib  = record                         { TIB Thread Information Block        }
    Tib_PExchain:         Pointer;      { Head of exception handler chain     }
    Tib_PStack:           Pointer;      { Pointer to base of stack            }
    Tib_PStackLimit:      Pointer;      { Pointer to end of stack             }
    Tib_PTib2:            PTib2;        { Pointer to system specific TIB      }
    Tib_Version:          ULong;        { Version number for this TIB structure}
    Tib_Ordinal:          ULong;        { Thread ordinal number               }
  end;

  PPib = ^Pib;
  Pib  = record                         { Process Information Block (PIB)     }
    Pib_ulPid:            ULong;        { Process I.D.                        }
    Pib_ulPPid:           ULong;        { Parent process I.D.                 }
    Pib_hMte:             ULong;        { Program (.EXE) module handle        }
    Pib_pchCmd:           PChar;        { Command line pointer                }
    Pib_pchEnv:           PChar;        { Environment pointer                 }
    Pib_flStatus:         ULong;        { Process' status bits                }
    Pib_ulType:           ULong;        { Process' type code                  }
  end;

function DosCreateThread(var Tid: Tid; Fn: FnThread; Param,Flag,cbStack: ULong): ApiRet;
function DosResumeThread(Tid: Tid): ApiRet;
function DosSuspendThread(Tid: Tid): ApiRet;
function DosGetInfoBlocks(var Tib: PTib; var TPib: PPib): ApiRet;
function DosKillThread(TTid: Tid): ApiRet;
function DosAllocThreadLocalMemory(cb: ULong; var P: PLong): ApiRet;
function DosFreeThreadLocalMemory(P: PLong): ApiRet;

{ Action code values }
const
  dcwa_Process                  = 0;
  dcwa_ProcessTree              = 1;

{ Wait option values }
  dcww_Wait                     = 0;
  dcww_NoWait                   = 1;

{ Thread Flags for DosCreateThread options }

  create_Ready                  = 0;
  create_Suspended              = 1;
  stack_Sparse                  = 0;
  stack_Committed               = 2;

type
  PResultCodes = ^ResultCodes;
  ResultCodes = record
    codeTerminate: ULong;
    codeResult:    ULong;
  end;

function DosWaitChild(Action,Option: ULong; var Result: ResultCodes; var RetPID: Pid; Pid: Pid): ApiRet;
function DosWaitThread(var Tid: Tid; Option: ULong): ApiRet;
function DosSleep(MSec: ULong): ApiRet;

{ Buffer for DosDebug }
type
  PDebug_Buffer = ^Debug_Buffer;
  Debug_Buffer = record
   Pid:    Longint;     {  Debuggee Process ID        }
   Tid:    Longint;     {  Debuggee Thread ID         }
   Cmd:    Longint;     {  Command or Notification    }
   Value:  Longint;     {  Generic Data Value         }
   Addr:   Longint;     {  Debuggee Address           }
   Buffer: Longint;     {  Debugger Buffer Address    }
   Len:    Longint;     {  Length of Range            }
   Index:  Longint;     {  Generic Identifier Index   }
   MTE:    Longint;     {  Module Handle              }
   EAX:    Longint;     {  Register Set               }
   ECX:    Longint;
   EDX:    Longint;
   EBX:    Longint;
   ESP:    Longint;
   EBP:    Longint;
   ESI:    Longint;
   EDI:    Longint;
   EFlags: Longint;
   EIP:    Longint;
   CSLim:  Longint;     {  Byte Granular Limits }
   CSBase: Longint;     {  Byte Granular Base   }
   CSAcc:  Byte;        {  Access Rights        }
   CSAtr:  Byte;        {  Attributes           }
   CS:     SmallWord;
   DSLim:  Longint;
   DSBase: Longint;
   DSAcc:  Byte;
   DSAtr:  Byte;
   DS:     SmallWord;
   ESLim:  Longint;
   ESBase: Longint;
   ESAcc:  Byte;
   ESAtr:  Byte;
   ES:     SmallWord;
   FSLim:  Longint;
   FSBase: Longint;
   FSAcc:  Byte;
   FSAtr:  Byte;
   FS:     SmallWord;
   GSLim:  Longint;
   GSBase: Longint;
   GSAcc:  Byte;
   GSAtr:  Byte;
   GS:     SmallWord;
   SSLim:  Longint;
   SSBase: Longint;
   SSAcc:  Byte;
   SSAtr:  Byte;
   SS:     SmallWord;
  end;

{ DosDebug Commands }
const
  dbg_c_Null                    = 0;
  dbg_c_ReadMem                 = 1;
  dbg_c_ReadReg                 = 3;
  dbg_c_WriteMem                = 4;
  dbg_c_WriteReg                = 6;
  dbg_c_Go                      = 7;
  dbg_c_Term                    = 8;
  dbg_c_SStep                   = 9;
  dbg_c_Stop                    = 10;
  dbg_c_Freeze                  = 11;
  dbg_c_Resume                  = 12;
  dbg_c_NumToAddr               = 13;
  dbg_c_ReadCoRegs              = 14;
  dbg_c_WriteCoRegs             = 15;
  dbg_c_ThrdStat                = 17;
  dbg_c_MapROAlias              = 18;
  dbg_c_MapRWAlias              = 19;
  dbg_c_UnMapAlias              = 20;
  dbg_c_Connect                 = 21;
  dbg_c_ReadMemBuf              = 22;
  dbg_c_WriteMemBuf             = 23;
  dbg_c_SetWatch                = 24;
  dbg_c_ClearWatch              = 25;
  dbg_c_RangeStep               = 26;
  dbg_c_Continue                = 27;
  dbg_c_AddrToObject            = 28;
  dbg_c_XchngOpcode             = 29;
  dbg_c_LinToSel                = 30;
  dbg_c_SelToLin                = 31;

{ DosDebug Notifications }
  dbg_n_Success                 =  0;
  dbg_n_Error                   = -1;
  dbg_n_ProcTerm                = -6;
  dbg_n_Exception               = -7;
  dbg_n_ModuleLoad              = -8;
  dbg_n_CoError                 = -9;
  dbg_n_ThreadTerm              = -10;
  dbg_n_AsyncStop               = -11;
  dbg_n_NewProc                 = -12;
  dbg_n_AliasFree               = -13;
  dbg_n_Watchpoint              = -14;
  dbg_n_ThreadCreate            = -15;
  dbg_n_ModuleFree              = -16;
  dbg_n_RangeStep               = -17;
{ Object flags }
  dbg_o_ObjMte                  = $10000000;
{ Watchpoint Scopes }
  dbg_w_Global                  = $00000001;
  dbg_w_Local                   = $00000002;
{ Watchpoint types }
  dbg_w_Execute                 = $00010000;
  dbg_w_Write                   = $00020000;
  dbg_w_ReadWrite               = $00030000;
{ Thread debugging state }
  dbg_d_Thawed                  = 0;
  dbg_d_Frozen                  = 1;
{ Thread scheduling state }
  dbg_t_Runnable                = 0;
  dbg_t_Suspended               = 1;
  dbg_t_Blocked                 = 2;
  dbg_t_CritSec                 = 3;
{ DosDebug debugging level }
  dbg_l_386                     = 1;
{ Coprocessor type identifier }
  dbg_co_387                    = 1;
{ The length of the coprocessor buffer }
  dbg_len_387                   = 108;
  dbg_x_Pre_First_Chance        = $00000000;
  dbg_x_First_Chance            = $00000001;
  dbg_x_Last_Chance             = $00000002;
  dbg_x_Stack_Invalid           = $00000003;

type
  PTStat = ^TStat;
  TStat = record
    DbgState:  Byte;            { Thread's Debugging State    }
    TState:    Byte;            { Thread's Scheduler State    }
    TPriority: SmallWord;       { Thread's Scheduler Priority }
  end;

function DosDebug(var DbgBuf: Debug_Buffer): ApiRet;

{ codeTerminate values (also passed to ExitList routines) }
const
  tc_Exit                       = 0;
  tc_HardError                  = 1;
  tc_Trap                       = 2;
  tc_KillProcess                = 3;
  tc_Exception                  = 4;

type
  FnExitList = procedure(Parm: ULong);

function DosEnterCritSec: ApiRet;
function DosExitCritSec:  ApiRet;
function DosExitList(OrderCode: ULong; ExitFn: FnExitList): ApiRet;

{ DosExitList functions }
const
  exlst_Add                     = 1;
  exlst_Remove                  = 2;
  exlst_Exit                    = 3;

function DosExecPgm(ObjName: PChar; cbObjName: Long; ExecFlag: ULong;
  Arg,Env: PChar; var Result: ResultCodes; Name: PChar): ApiRet;

{ DosExecPgm functions }
const
  exec_Sync                     = 0;
  exec_Async                    = 1;
  exec_AsyncResult              = 2;
  exec_Trace                    = 3;
  exec_BackGround               = 4;
  exec_Load                     = 5;
  exec_AsyncResultDb            = 6;

function DosSetPriority(Scope,PrtyClass: ULong; Delta: Long; PorTid: ULong): ApiRet;

{ Priority scopes }
const
  prtys_Process                 = 0;
  prtys_ProcessTree             = 1;
  prtys_Thread                  = 2;

{ Priority classes }
  prtyc_NoChange                = 0;
  prtyc_IdleTime                = 1;
  prtyc_Regular                 = 2;
  prtyc_TimeCritical            = 3;
  prtyc_ForegroundServer        = 4;

{ Priority deltas }
  prtyd_Minimum                 = -31;
  prtyd_Maximum                 = +31;

function DosKillProcess(Action: ULong; Pid: Pid): ApiRet;

const
  dkp_ProcessTree               = 0;
  dkp_Process                   = 1;

{*** File manager ***}

{ DosSetFilePtr file position codes }
  file_Begin                    = $0000; { Move relative to beginning of = file }
  file_Current                  = $0001; { Move relative to current fptr = position }
  file_End                      = $0002; { Move relative to end of = file }

{ DosFindFirst/Next Directory handle types }
  hdir_System                   =  1;    { Use system handle (= 1)         }
  hdir_Create                   = -1;    { Allocate a new, unused = handle }

{ DosCopy control bits; may be or'ed together }
  dcpy_Existing                 = $0001; { Copy even if target = exists }
  dcpy_Append                   = $0002; { Append to existing file, do not = replace }
  dcpy_FailEas                  = $0004; { Fail if EAs not supported on = target }

{ DosOpen/DosQFHandState/DosQueryFileInfo et al file attributes; also }
{ known as Dos File Mode bits... }
  file_Normal                   = $0000;
  file_ReadOnly                 = $0001;
  file_Hidden                   = $0002;
  file_System                   = $0004;
  file_Directory                = $0010;
  file_Archived                 = $0020;
  file_Ignore                   = $10000;       { ignore file attribute = in }
                                                { DosSetPath/File Info if    }
                                                { this bit is set            }

  must_have_ReadOnly    = (file_ReadOnly  shl 8) or file_ReadOnly;
  must_have_Hidden      = (file_Hidden    shl 8) or file_Hidden;
  must_have_System      = (file_System    shl 8) or file_System;
  must_have_Directory   = (file_Directory shl 8) or file_Directory;
  must_have_Archived    = (file_Archived  shl 8) or file_Archived;

{ DosOpen actions }
  file_Existed                  = $0001;
  file_Created                  = $0002;
  file_Truncated                = $0003;

{ DosOpen open flags }
  file_Open                     = $0001;
  file_Truncate                 = $0002;
  file_Create                   = $0010;

{ This nibble applies if file already exists              xxxx }
  open_action_Fail_If_Exists    = $0000; { ---- ---- ---- 0000 }
  open_action_Open_If_Exists    = $0001; { ---- ---- ---- 0001 }
  open_action_Replace_If_Exists = $0002; { ---- ---- ---- 0010 }

{ This nibble applies if file does not exist         xxxx      }
  open_action_Fail_If_New       = $0000; { ---- ---- 0000 ---- }
  open_action_Create_If_New     = $0010; { ---- ---- 0001 ---- }

{ DosOpen/DosSetFHandState flags }
  open_access_ReadOnly          = $0000; { ---- ---- ---- -000 }
  open_access_WriteOnly         = $0001; { ---- ---- ---- -001 }
  open_access_ReadWrite         = $0002; { ---- ---- ---- -010 }
  open_share_DenyReadWrite      = $0010; { ---- ---- -001 ---- }
  open_share_DenyWrite          = $0020; { ---- ---- -010 ---- }
  open_share_DenyRead           = $0030; { ---- ---- -011 ---- }
  open_share_DenyNone           = $0040; { ---- ---- -100 ---- }
  open_flags_NoInherit          = $0080; { ---- ---- 1--- ---- }
  open_flags_No_Locality        = $0000; { ---- -000 ---- ---- }
  open_flags_Sequential         = $0100; { ---- -001 ---- ---- }
  open_flags_Random             = $0200; { ---- -010 ---- ---- }
  open_flags_RandomSequential   = $0300; { ---- -011 ---- ---- }
  open_flags_No_Cache           = $1000; { ---1 ---- ---- ---- }
  open_flags_Fail_On_Error      = $2000; { --1- ---- ---- ---- }
  open_flags_Write_Through      = $4000; { -1-- ---- ---- ---- }
  open_flags_Dasd               = $8000; { 1--- ---- ---- ---- }
  open_flags_NonSpooled         = $00040000;

  search_Path                   = $0000;
  search_Cur_Directory          = $0001;
  search_Environment            = $0002;
  search_IgnoreNetErrs          = $0004;

{
  EA Info Levels & Find First/Next
  API's: DosFindFirst, DosQueryFileInfo, DosQueryPathInfo, DosSetFileInfo,
          DosSetPathInfo
}

{ File info levels&gml All listed API's }
  fil_Standard                  = 1;    { Info level 1, standard file info }
  fil_QueryEaSize               = 2;    { Level 2, return Full EA size     }
  fil_QueryEasFromList          = 3;    { Level 3, return requested EA's   }

{ File info levels: Dos...PathInfo only }
  fil_QueryFullName             = 5;    { Level 5, return fully qualified name of file }
{ DosFsAttach: Attact or detach }
  fs_Attach                     = 0;    { Attach file server }
  fs_Detach                     = 1;    { Detach file server }
  fs_SpoolAttach                = 2;    { Register a spooler device }
  fs_SpoolDetach                = 3;    { De-register a spooler device }

{ DosFsCtl: Routing type }
  fsctl_Handle                  = 1;    { File Handle directs req routing }
  fsctl_PathName                = 2;    { Path Name directs req routing }
  fsctl_FsdName                 = 3;    { FSD Name directs req routing }

{ defined FSCTL functions }
  fsctl_Error_Info              = 1;    { return error info from FSD }
  fsctl_Max_EaSize              = 2;    { Max ea size for the FSD }

type
  PEaSizeBuf = ^EaSizeBuf;
  EaSizeBuf = record                    { Record for FSCTL fn 2 - max ea size }
    cbMaxEASize:     SmallWord;         { max. size of one EA }
    cbMaxEAListSize: ULong;             { max size of the full EA List }
  end;

{ DosQueryFSAttach: Information level types (defines method of query) }
const
  fsail_QueryName               = 1;    { Return data for a Drive or Device }
  fsail_DevNumber               = 2;    { Return data for Ordinal Device # }
  fsail_DrvNumber               = 3;    { Return data for Ordinal Drive # }

{ Item types (from data structure item "iType") }
  fsat_CharDev                  = 1;    { Resident character device }
  fsat_PseudoDev                = 2;    { Pusedu-character device }
  fsat_LocalDrv                 = 3;    { Local drive }
  fsat_RemoteDrv                = 4;    { Remote drive attached to FSD }

type
  PFsqBuffer = ^FsqBuffer;
  FsqBuffer = record                    { fsqbuf Data structure for QFSAttach}
    iType:        SmallWord;            { Item type }
    cbName:       SmallWord;            { Length of item name, sans NULL }
    szName:    array [0..0] of Char;    { ASCIIZ item name }
    cbFSDName:    SmallWord;            { Length of FSD name, sans NULL }
    szFSDName: array [0..0] of Char;    { ASCIIZ FSD name }
    cbFSAData:    SmallWord;            { Length of FSD Attach data returned }
    rgFSAData: array [0..0] of Byte;    { FSD Attach data from FSD }
  end;

  PFsqBuffer2 = ^FsqBuffer2;            { fsqbuf Data structure for QFSAttach}
  FsqBuffer2 = record
    iType:        SmallWord;
    cbName:       SmallWord;
    cbFSDName:    SmallWord;
    cbFSAData:    SmallWord;
    szName:    array [0..0] of Char;
    szFSDName: array [0..0] of Char;
    rgFSAData: array [0..0] of Byte;
  end;

  PSpoolAttach = ^SpoolAttach;  { Data structure for spooler operations }
  SpoolAttach = record
    hNmPipe: SmallWord;         { Named pipe handle }
    ulKey:   ULong;             { Attached key }
  end;

{ File System Drive Information&gml DosQueryFSInfo DosSetFSInfo }
{ FS Drive Info Levels }
const
  fsil_Alloc                    = 1;    { Drive allocation info (Query only) }
  fsil_VolSer                   = 2;    { Drive Volum/Serial info }

{ DosQueryFHType: Handle classes (low 8 bits of Handle Type) }
  fht_DiskFile                  = $0000;  { Disk file handle }
  fht_ChrDev                    = $0001;  { Character device handle }
  fht_Pipe                      = $0002;  { Pipe handle }

{ Handle bits (high 8 bits of Handle Type)}
  fhb_DskRemote                 = $8000;  { Remote disk }
  fhb_ChrDevRemote              = $8000;  { Remote character device }
  fhb_PipeRemote                = $8000;  { Remote pipe }

{ File time and date types }
(*
      typedef struct _FTIME
              {
              UINT   twosecs : 5;
              UINT   minutes : 6;
              UINT   hours   : 5;
              } FTIME;
*)

type
  PFTime = ^FTime;
  FTime = SmallWord;

const
  mftTwoSecs                    = $001F;
  sftTwoSecs                    = 0;
  mftMinutes                    = $07E0;
  sftMinutes                    = 5;
  mftHours                      = $F800;
  sftHours                      = 11;

(*    typedef struct _FDATE
              {
              UINT   day     : 5;
              UINT   month   : 4;
              UINT   year    : 7;
              } FDATE;
*)

type
  PFDate = ^FDate;
  FDate = SmallWord;

const
  mfdDay                        = $001F;
  sfdDay                        = 0;
  mfdMonth                      = $01E0;
  sfdMonth                      = 5;
  mfdYear                       = $FE00;
  sfdYear                       = 9;

type
  PVolumeLabel = ^VolumeLabel;
  VolumeLabel = String[12];

  PFsInfo = ^FsInfo;
  FsInfo = record
    fdateCreation:  FDate;
    ftimeCreation:  FTime;
    vol:            VolumeLabel;
  end;

{ HandType values }
const
  handtype_File                 = $0000;
  handtype_Device               = $0001;
  handtype_Pipe                 = $0002;
  handtype_Network              = $8000;

type
  PFileLock = ^FileLock;
  FileLock = record
    lOffset: Long;
    lRange:  Long;
  end;

  PHFile = ^HFile;
  HFile  = LHandle;
  PHEv   = ^HEv;
  HEv    = ULong;

function DosSetFileLocks(F: HFile; var UnLock,Lock: FileLock; Timeout,Flags: ULong): ApiRet;
function DosCancelLockRequest(F: HFile; var Lock: FileLock): ApiRet;

type
  PFileFindBuf = ^FileFindBuf;
  FileFindBuf = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        SmallWord;
    achName:         String[cchMaxPathComp-1];
  end;

  PFileFindBuf2 = ^FileFindBuf2;
  FileFindBuf2 = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        SmallWord;
    cbList:          ULong;
    achName:         String[cchMaxPathComp-1];
  end;

  PFileFindBuf3 = ^FileFindBuf3;
  FileFindBuf3 = record
    oNextEntryOffset: ULong;    { new field }
    fdateCreation:    FDate;
    ftimeCreation:    FTime;
    fdateLastAccess:  FDate;
    ftimeLastAccess:  FTime;
    fdateLastWrite:   FDate;
    ftimeLastWrite:   FTime;
    cbFile:           ULong;
    cbFileAlloc:      ULong;
    attrFile:         ULong;    { widened field }
    achName:          String[cchMaxPathComp-1];
  end;

  PFileFindBuf4 = ^FileFindBuf4;
  FileFindBuf4 = record
    oNextEntryOffset: ULong;    { new field }
    fdateCreation:    FDate;
    ftimeCreation:    FTime;
    fdateLastAccess:  FDate;
    ftimeLastAccess:  FTime;
    fdateLastWrite:   FDate;
    ftimeLastWrite:   FTime;
    cbFile:           ULong;
    cbFileAlloc:      ULong;
    attrFile:         ULong;    { widened field }
    cbList:           ULong;
    achName:          String[cchMaxPathComp-1];
  end;

{ extended attribute structures }
  PGea  = ^Gea;
  Gea = record
    cbName: Byte;                 { name length not including NULL }
    szName: array [0..0] of Char; { attribute name }
  end;

  PGeaList = ^GeaList;
  GeaList = record
    cbList: ULong;              { total bytes of structure including full list }
    list: array[0..0] of Gea;   { variable length GEA structures }
  end;

  PFea = ^Fea;
  Fea = record
    fEA:     Byte;               { flags }
    cbName:  Byte;               { name length not including NULL }
    cbValue: SmallWord;          { value length }
  end;

{ flags for _FEA.fEA }
const
  fea_NeedEA                    = $80;  { need EA bit }

type
  PFeaList = ^FeaList;
  FeaList = record
    cbList:  ULong;             { total bytes of structure including full list }
    list: array [0..0] of Fea;  { variable length FEA structures }
  end;

  PEaop = ^Eaop;
  Eaop = record
    fpGEAList: PGeaList;        { general EA list }
    fpFEAList: PFeaList;        { full EA list }
    oError:    ULong;
  end;

  PFea2 = ^Fea2;
  Fea2 = record
    oNextEntryOffset: ULong;    { new field }
    fEA:              Byte;
    cbName:           Byte;
    cbValue:          SmallWord;
    szName:           Char;     { new field }
  end;

  PFea2List = ^Fea2List;
  Fea2List = record
    cbList:           ULong;
    list: array [0..0] of Fea2;
  end;

  PGea2 = ^Gea2;
  Gea2 = record
    oNextEntryOffset: ULong;      { new field }
    cbName:           Byte;
    szName: array [0..0] of Char;
  end;

  PGea2List = ^Gea2List;
  Gea2List = record
    cbList: ULong;
    list: array[0..0] of Gea2;
  end;

  PEaop2 = ^Eaop2;
  Eaop2 = record
    fpGEA2List: PGea2List;      { GEA set }
    fpFEA2List: PFea2List;      { FEA set }
    oError:    ULong;           { offset of FEA error }
  end;

{ Constants for the types of EAs that follow the convention that we have established
  Values $FFFE thru $8000 are reserved.
  Values $0000 thru $7FFF are user definable.
  Value  $FFFC is not used
}
const
  eat_Binary                    = $FFFE;     { length preceeded binary }
  eat_Ascii                     = $FFFD;     { length preceeded ASCII }
  eat_BitMap                    = $FFFB;     { length preceeded bitmap }
  eat_MetaFile                  = $FFFA;     { length preceeded metafile }
  eat_Icon                      = $FFF9;     { length preceeded icon }
  eat_Ea                        = $FFEE;     { length preceeded ASCII }
                                             { name of associated data }
  eat_Mvmt                      = $FFDF;     { multi-valued, multi-typed field }
  eat_Mvst                      = $FFDE;     { multi-valued, single-typed field }
  eat_Asn1                      = $FFDD;     { ASN.1 field }

function DosOpen(FileName: PChar; var F: HFile; var Action: ULong;
  cbFile,Attribute,OpenFlags,OpenMode: ULong; EAs: PEaop2): ApiRet;
function DosClose(F: HFile): ApiRet;
function DosRead(F: HFile; var Buffer; cbRead: ULong; var Actual: ULong): ApiRet;
function DosWrite(F: HFile; const Buffer; cbWrite: ULong; var Actual: ULong): ApiRet;

function DosProtectClose(F: hFile; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectEnumAttribute(ulRefType: ULong; pvFile: Pointer;
  ulEntry: ULong; Var pvBuf; cbBuf: ULong; Var Count: ULong;
  InfoLevel: ULong; fhFileHandleLockID: FHLock ): ApiRet;
function DosProtectOpen(FileName: PChar; var F: HFile; var Action: ULong;
  cbFile,Attribute,OpenFlags,OpenMode: ULong; EAs: PEaop2;
  Var fhFileHandleLockID: FHLock): ApiRet;
function DosProtectQueryFHState(hFile: HFile;Var Mode: ULong;
  fhFileHandleLockID: FHLock): ApiRet;
function DosProtectQueryFileInfo(F: HFile; InfoLevel: ULong; pInfo: Pointer;
  cbInfoBuf: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectRead(F: HFile; var Buffer; cbRead: ULong;
  var Actual: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectSetFHState(F: hFile; Mode: ULong;fhFileHandleLockID: FHLock): ApiRet;
function DosProtectSetFileInfo(F: hFile; InfoLevel: ULong; Var Buffer;
  cbInfoBuf: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectSetFileLocks(F: HFile; var UnLock,Lock: FileLock;
  Timeout,Flags: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectSetFilePtr(F: HFile; Distance: Long; Method: ULong;
  var Actual: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectSetFileSize(F: HFile; Size: ULong; fhFileHandleLockID: FHLock): ApiRet;
function DosProtectWrite(F: HFile; const Buffer; cbWrite: ULong;
  var Actual: ULong; fhFileHandleLockID: FHLock): ApiRet;

{ File time and date types }
type
  PFileStatus = ^FileStatus;
  FileStatus = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        SmallWord;
  end;

  PFileStatus2 = ^FileStatus2;
  FileStatus2 = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        SmallWord;
    cbList:          ULong;
  end;

  PFileStatus3 = ^FileStatus3;
  FileStatus3 = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        ULong;
  end;

  PFileStatus4 = ^FileStatus4;
  FileStatus4 = record
    fdateCreation:   FDate;
    ftimeCreation:   FTime;
    fdateLastAccess: FDate;
    ftimeLastAccess: FTime;
    fdateLastWrite:  FDate;
    ftimeLastWrite:  FTime;
    cbFile:          ULong;
    cbFileAlloc:     ULong;
    attrFile:        ULong;
    cbList:          ULong;
  end;

  PFsAllocate = ^FsAllocate;
  FsAllocate = record
    idFileSystem: ULong;
    cSectorUnit:  ULong;
    cUnit:        ULong;
    cUnitAvail:   ULong;
    cbSector:     SmallWord;
  end;

  PHDir = ^HDir;
  HDir = LHandle;

function DosDelete(FName: PChar): ApiRet;
function DosForceDelete(FName: PChar): ApiRet;
function DosDupHandle(OldHandle: HFile; var NewHandle: HFile): ApiRet;
function DosQueryFHState(F: HFile; var Mode: ULong): ApiRet;
function DosSetFHState(F: HFile; Mode: ULong): ApiRet;
function DosQueryHType(F: HFile; var pType,pAttr: ULong): ApiRet;
function DosFindFirst(FileSpec: PChar; var Dir: HDir; Attribute: ULong;
  var FindBuf; BufSize: ULong; var SearchCount: ULong; InfoLevel: ULong): ApiRet;
function DosFindNext(Dir: HDir; var FindBuf; BufSize: ULong; var SearchCount: ULong): ApiRet;
function DosFindClose(Dir: HDir): ApiRet;
function DosFSAttach(Device,FileSystem: PChar; pDate: Pointer; cbData,Flag: ULong): ApiRet;
function DosQueryFSAttach(DeviceName: PChar; Ordinal,FSAInfoLevel: ULong;
  pfsqb: pFsqBuffer2; var BufLen: ULong): ApiRet;
function DosFSCtl(pData: Pointer; cbData: ULong; var pcbData: PULong;
  pParms: Pointer; cbParams: ULong; var pcbParms: ULong; Func: ULong;
  Route: PChar; F: HFile; Method: ULong): ApiRet;
function DosSetFileSize(F: HFile; Size: ULong): ApiRet;
function DosResetBuffer(F: HFile): ApiRet;
function DosSetFilePtr(F: HFile; Distance: Long; Method: ULong; var Actual: ULong): ApiRet;
function DosMove(OldName,NewName: PChar): ApiRet;
function DosCopy(OldName,NewName: PChar; Option: ULong): ApiRet;
function DosEditName(MetaLevel: ULong; Source,Edit: PChar; Target: PChar; cbTarget: ULong): ApiRet;
function DosCreateDir(DirName: PChar; Eas: PEaop2): ApiRet;
function DosDeleteDir(Dir: PChar): ApiRet;
function DosSetDefaultDisk(DiskNum: ULong): ApiRet;
function DosQueryCurrentDisk(var DiskNum,Logical: ULong): ApiRet;
function DosSetCurrentDir(Dir: PChar): ApiRet;
function DosQueryCurrentDir(DiskNum: ULong; var Buf; var BufSize: ULong): ApiRet;
function DosQueryFSInfo(DiskNum,InfoLevel: ULong; var Buf; BufSize: ULong): ApiRet;
function DosSetFSInfo(DiskNum,InfoLevel: ULong; var Buf; BufSize: ULong): ApiRet;
function DosQueryVerify(var Flag: Bool): ApiRet;
function DosSetVerify(Flag: Bool): ApiRet;
function DosSetMaxFH(cFH: ULong): ApiRet;
function DosSetRelMaxFH(var cbReqCount,cbCurMaxFH: Long): ApiRet;
function DosQueryFileInfo(F: HFile; InfoLevel: ULong; var InfoBuf;
  cbInfoBuf: ULong): ApiRet;
function DosSetFileInfo(F: HFile; InfoLevel: ULong; var InfoBuf;
  cbInfoBuf: ULong): ApiRet;
function DosQueryPathInfo(PathName: PChar; InfoLevel: ULong; var InfoBuf;
  cbInfoBuf: ULong): ApiRet;
function DosSetPathInfo(PathName: PChar; InfoLevel: ULong; var InfoBuf;
  cbInfoBuf,Options: ULong): ApiRet;

{ Constant for DosSetPathInfo: pathinfo flag }
const
  dspi_WrtThru                  = $10;  { write through }

function DosShutdown(Reserved: ULong): ApiRet;
function DosEnumAttribute(RefType: ULong; pvFile: Pointer; Entry: ULong;
  var pvBuf; cbBuf: ULong; var Count: ULong; InfoLevel: ULong): ApiRet;

type
  PDena1 = ^Dena1;
  Dena1 = record        { dena1 level 1 info returned from DosEnumAttribute }
    reserved:   Byte;              { 0 }
    cbName:     Byte;              { length of name exculding NULL }
    cbValue:    SmallWord;         { length of value }
    szName: array [0..0] of Char;  { variable length asciiz name }
  end;

{ Infolevels for DosEnumAttribute  }
const
  enumea_Level_No_Value         = 1;     { FEA without value }
{ Reference types for DosEnumAttribute }
  enumea_Reftype_FHandle        = 0;      { file handle }
  enumea_Reftype_Path           = 1;      { path name }
  enumea_Reftype_Max            = enumea_Reftype_Path;

{ Memory management }

function DosAllocMem(var Base: Pointer; MemSize,Flags: ULong): ApiRet;
function DosFreeMem(Base: Pointer): ApiRet;
function DosSetMem(Base: Pointer; MemSize,Flags: ULong): ApiRet;
function DosGiveSharedMem(Base: Pointer; Pid: Pid; Flags: ULong): ApiRet;
function DosGetSharedMem(Base: Pointer; Flags: ULong): ApiRet;
function DosGetNamedSharedMem(var Base: Pointer; Name: PChar; Flags: ULong): ApiRet;
function DosAllocSharedMem(var Base: Pointer; Name: PChar; MemSize,Flags: ULong): ApiRet;
function DosQueryMem(Base: Pointer; var MemSize,Flags: ULong): ApiRet;
function DosSubAllocMem(Base: Pointer; var SubBase: Pointer; MemSize: ULong): ApiRet;
function DosSubFreeMem(Base,SubBase: Pointer; MemSize: ULong): ApiRet;
function DosSubSetMem(Base: Pointer; Flag,MemSize: ULong): ApiRet;
function DosSubUnsetMem(Base: Pointer): ApiRet;

{*** Memory flags ***}
{ Access protection  }
const
  pag_Read                      = $00000001;    { read access              }
  pag_Write                     = $00000002;    { write access             }
  pag_Execute                   = $00000004;    { execute access           }
  pag_Guard                     = $00000008;    { guard protection         }
  pag_Default                   = $00000400;    { default (initial) access }
 { Commit }
  pag_Commit                    = $00000010;    { commit storage           }
  pag_Decommit                  = $00000020;    { decommit storage         }
 { Allocation attributes }
  obj_Tile                      = $00000040;    { tile object              }
  obj_Protected                 = $00000080;    { protect object;
                         NOTE: This flag is NOT available at the API level }
  obj_Gettable                  = $00000100;    { gettable by other processes}
  obj_Giveable                  = $00000200;    { giveable to other processes}
  fPerm                         = pag_Execute or pag_Read or pag_Write;
  fShare                        = obj_Gettable or obj_Giveable;
 { DosAllocMem flags }
  fAlloc                        = obj_Tile or pag_Commit or fPerm;
 { DosAllocSharedMem flags }
  fAllocShr                     = obj_Tile or pag_Commit or fShare or fPerm;
 { DosGetNamedSharedMem flags }
  fGetNmShr                     = fPerm;
 { DosGetSharedMem flags }
  fGetShr                       = fPerm;
 { DosGiveSharedMem flags }
  fGiveShr                      = fPerm;
 { DosSetMem flags }
  fSet                          = pag_Commit + pag_Decommit + pag_Default + fPerm;
 { DosSubSet flags }
  dossub_Init                   = $01;  { initialize memory object for suballocation }
  dossub_Grow                   = $02;  { increase size of memory pool for suballocation }
  dossub_Sparse_Obj             = $04;  { indicator for DosSub to manage the
                                          commitment of pages spanned by the memory pool }
  dossub_Serialize              = $08;  { indicates that access to the memory }
                                        { pool is to be serialized by DosSub  }
 { Allocation type (returned from DosQueryMem)                                }
  pag_Shared                    = $00002000;    { shared object        }
  pag_Free                      = $00004000;    { pages are free       }
  pag_Base                      = $00010000;    { first page in object }

{*** Semaphore Support ***}
{ Semaphore Attributes }

  dc_Sem_Shared                 = $01;  { DosCreateMutex, DosCreateEvent, and     }
                                        {   DosCreateMuxWait use it to indicate   }
                                        {   whether the semaphore is shared or    }
                                        {   private when the PSZ is null          }
  dcmw_Wait_Any                 = $02;  { DosCreateMuxWait option for wait on any }
                                        {   event/mutex to occur                  }
  dcmw_Wait_All                 = $04;  { DosCreateMuxWait option for wait on all }
                                        {   events/mutexs to occur                }

  sem_Indefinite_Wait           = -1;
  sem_Immediate_Return          =  0;

type
  PHSem = ^HSem;
  HSem = Pointer;

  PSemRecord = ^SemRecord;
  SemRecord = record
    hsemCur: HSem;
    ulUser:  ULong;
  end;

  PHMtx = ^HMtx;
  HMtx  = ULong;
  PHMux = ^HMux;
  HMux  = ULong;

function DosCreateEventSem(Name: PChar; var EvSem: HEv; Attr: ULong; State: Bool): ApiRet;
function DosOpenEventSem(Name: PChar; var EvSem: HEv): ApiRet;
function DosCloseEventSem(EvSem: HEv): ApiRet;
function DosResetEventSem(EvSem: HEv; var PostCount: ULong): ApiRet;
function DosPostEventSem(EvSem: HEv): ApiRet;
function DosWaitEventSem(EvSem: HEv; Timeout: ULong): ApiRet;
function DosQueryEventSem(EvSem: HEv; var PosCount: ULong): ApiRet;
function DosCreateMutexSem(Name: PChar; var Mtx: HMtx; Attr: ULong; State: Bool): ApiRet;
function DosOpenMutexSem(Name: PChar; var Mtx: HMtx): ApiRet;
function DosCloseMutexSem(Mtx: HMtx): ApiRet;
function DosRequestMutexSem(Mxt: HMtx; Timeout: ULong): ApiRet;
function DosReleaseMutexSem(Mtx: HMtx): ApiRet;
function DosQueryMutexSem(Mtx: HMtx; var Pid: Pid; var Tid: Tid; var Count: ULong): ApiRet;
function DosCreateMuxWaitSem(Name: PChar; var Mux: HMux; cSemRec: ULong; var SemRec: SemRecord; Attr: ULong): ApiRet;
function DosOpenMuxWaitSem(Name: PChar; var Mux: HMux): ApiRet;
function DosCloseMuxWaitSem(Mux: HMux): ApiRet;
function DosWaitMuxWaitSem(Mux: HMux; Timeout: ULong; var User: ULong): ApiRet;
function DosAddMuxWaitSem(Mux: HMux; var SemRec: SemRecord): ApiRet;
function DosDeleteMuxWaitSem(Mux: HMux; Sem: HSem): ApiRet;
function DosQueryMuxWaitSem(Mux: HMux; var cSemRec: ULong; SemRec: SemRecord; var Attr: ULong): ApiRet;

{ Time support }
type
  PDateTime = ^DateTime;
  DateTime = record
    hours:      Byte;
    minutes:    Byte;
    seconds:    Byte;
    hundredths: Byte;
    day:        Byte;
    month:      Byte;
    year:       SmallWord;
    timezone:   SmallInt;
    weekday:    Byte;
  end;

function DosGetDateTime(var DT: DateTime): ApiRet;
function DosSetDateTime(var DT: DateTime): ApiRet;

type
  PHTimer = ^HTimer;
  HTimer = LHandle;

function DosAsyncTimer(MSec: ULong; Sem: HSem; var Timer: HTimer): ApiRet;
function DosStartTimer(MSec: ULong; Sem: HSem; var Timer: HTimer): ApiRet;
function DosStopTimer(Timer: HTimer): ApiRet;

{ Module manager }

function DosLoadModule(Name: PChar; cbName: ULong; ModName: PChar; var Module: HModule): ApiRet;
function DosFreeModule(Module: HModule): ApiRet;
function DosQueryProcAddr(Module: HModule; Ordinal: ULong; Name: PChar; var EntryAddr: Pointer): ApiRet;
function DosQueryModuleHandle(ModName: PChar; var Module: HModule): ApiRet;
function DosQueryModuleName(Module: HModule; cbName: ULong; Name: PChar): ApiRet;

const
  pt_16Bit                      = 0;
  pt_32Bit                      = 1;

function DosQueryProcType(Module: HModule; Ordinal: ULong; Name: PChar; var ProcType: ULong): ApiRet;

{ Resource support }
{ Predefined resource types }
const
  rt_Pointer                    = 1;  { mouse pointer shape }
  rt_Bitmap                     = 2;  { bitmap }
  rt_Menu                       = 3;  { menu template }
  rt_Dialog                     = 4;  { dialog template }
  rt_String                     = 5;  { string tables }
  rt_FontDir                    = 6;  { font directory }
  rt_Font                       = 7;  { font }
  rt_AccelTable                 = 8;  { accelerator tables }
  rt_RcData                     = 9;  { binary data }
  rt_Message                    = 10; { error msg tables }
  rt_DlgInclude                 = 11; { dialog include file name }
  rt_VKeyTbl                    = 12; { key to vkey tables }
  rt_KeyTbl                     = 13; { key to UGL tables }
  rt_CharTbl                    = 14; { glyph to character tables }
  rt_DisplayInfo                = 15; { screen display information }
  rt_FkaShort                   = 16; { function key area short form }
  rt_FkaLong                    = 17; { function key area Long form }
  rt_HelpTable                  = 18; { Help table for Cary Help manager }
  rt_HelpSubTable               = 19; { Help subtable for Cary Help manager }
  rt_FdDir                      = 20; { DBCS uniq/font driver directory }
  rt_Fd                         = 21; { DBCS uniq/font driver }
  rt_Max                        = 22; { 1st unused Resource Type }
  rf_OrdinalId                  = $80000000; { ordinal id flag in resource table }

function DosGetResource(Module: HModule; IdType,IdName: ULong; var ppb: Pointer): ApiRet;
function DosFreeResource(pb: Pointer): ApiRet;
function DosQueryResourceSize(Module: HModule; IdType,IdName: ULong; var Size: ULong): ApiRet;

{ NLS Support }
type
  PCountryCode = ^CountryCode;
  CountryCode = record
    country:  ULong;
    codepage: ULong;
  end;

  PCountryInfo = ^CountryInfo;
  CountryInfo = record
    country:              ULong;
    codepage:             ULong;
    fsDateFmt:            ULong;
    szCurrency:           array [0..4] of Char;
    szThousandsSeparator: array [0..1] of Char;
    szDecimal:            array [0..1] of Char;
    szDateSeparator:      array [0..1] of Char;
    szTimeSeparator:      array [0..1] of Char;
    fsCurrencyFmt:        Byte;
    cDecimalPlace:        Byte;
    fsTimeFmt:            Byte;
    abReserved1:          array [0..1] of SmallWord;
    szDataSeparator:      array [0..1] of Char;
    abReserved2:          array [0..4] of SmallWord;
  end;

function DosQueryCtryInfo(cb: ULong; var ccode: CountryCode; var pci: CountryInfo; var Actual: ULong): ApiRet;
function DosQueryDBCSEnv(cb: ULong; var ccode: CountryCode; Buf: PChar): ApiRet;
function DosMapCase(cb: ULong; var ccode: CountryCode; pch: PChar): ApiRet;
function DosQueryCollate(cb: ULong; var ccode: CountryCode; pch: PChar; var DataLen: ULong): ApiRet;
function DosQueryCp(cb: ULong; var arCP,pcCP: ULong): ApiRet;
function DosSetProcessCp(cp: ULong): ApiRet;

{ Signal support }
{ DosSetSignalExceptionFocus codes }
const
  sig_UnSetFocus                = 0;
  sig_SetFocus                  = 1;

{*** Exception Management ***}
{ User Exception Handler Return Codes: }
  xcpt_Continue_Search          = $00000000;     { exception not handled   }
  xcpt_Continue_Execution       = $FFFFFFFF;     { exception handled       }
  xcpt_Continue_Stop            = $00716668;     { exception handled by    }
                                                 { debugger (VIA DosDebug) }
{ fHandlerFlags values (see ExceptionReportRecord):
  The user may only set (but not clear) the eh_NonContinuable flag.
  All other flags are set by the system.
}

  eh_NonContinuable             = $01;          { Noncontinuable exception }
  eh_Unwinding                  = $02;          { Unwind is in progress }
  eh_Exit_Unwind                = $04;          { Exit unwind is in progress }
  eh_Stack_Invalid              = $08;          { Stack out of limits or unaligned }
  eh_Nested_Call                = $10;          { Nested exception handler call }

{ Unwind all exception handlers (see DosUnwindException API) }
  unwind_All                    = 0;
{ Exception values are 32 bit values layed out as follows:

  3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  +---+-+-------------------------+-------------------------------+
  |Sev|C|       Facility          |               Code            |
  +---+-+-------------------------+-------------------------------+

  where

      Sev - is the severity code
          00 - Success
          01 - Informational
          10 - Warning
          11 - Error

      C - is the Customer code flag

      Facility - is the facility code

      Code - is the facility's status code

  Exceptions specific to OS/2 2.0 (e.g. xcpt_Signal) will be marked
  with a facility code of 1.

  System defined exceptions have a facility code of zero.

  Each exception may also have several pieces of additional information.
  These are stored in the ExceptionInfo fields of the
  ExceptionReportRecord. They are documented here with the exceptions
  only for ease of reference.
 }
  xcpt_Fatal_Exception          = $C0000000;
  xcpt_Severity_Code            = $C0000000;
  xcpt_Customer_Code            = $20000000;
  xcpt_Facility_Code            = $1FFF0000;
  xcpt_Exception_Code           = $0000FFFF;
{ Violation flags in ExceptionInfo }
  xcpt_Unknown_Access           = $00000000;     { Unknown access }
  xcpt_Read_Access              = $00000001;     { Read access    }
  xcpt_Write_Access             = $00000002;     { Write access   }
  xcpt_Execute_Access           = $00000004;     { Execute access }
  xcpt_Space_Access             = $00000008;     { Address space access }
  xcpt_Limit_Access             = $00000010;     { Address space limit violation }
  xcpt_Data_Unknown             = $FFFFFFFF;
{ Signal numbers for xcpt_Signal }
  xcpt_Signal_Intr              = 1;
  xcpt_Signal_KillProc          = 3;
  xcpt_Signal_Break             = 4;
{ Portable non-fatal software generated exceptions }
  xcpt_Guard_Page_Violation     = $80000001;
{ ExceptionInfo[ 0 ] - Access Code: xcpt_Read_Access
                                    xcpt_Write_Access }
{ ExceptionInfo[ 1 ] - FaultAddr }
  xcpt_Unable_To_Grow_Stack     = $80010001;
{ Portable fatal hardware generated exceptions }
  xcpt_DataType_Misalignment    = $C000009E;
{ ExceptionInfo[ 0 ] - Access Code: xcpt_Read_Access
                                    xcpt_Write_Access }
{ ExceptionInfo[ 1 ] - Alignment }
{ ExceptionInfo[ 2 ] - FaultAddr }
  xcpt_Breakpoint               = $C000009F;
  xcpt_Single_Step              = $C00000A0;
  xcpt_Access_Violation         = $C0000005;
{ ExceptionInfo[ 0 ] - Access Code: xcpt_Read_Access
                                    xcpt_Write_Access
                                    xcpt_Space_Access
                                    xcpt_Limit_Access
                                    xcpt_Unknown_Access }
{ ExceptionInfo[ 1 ] - FaultAddr (xcpt_Read_Access/xcpt_Write_Access)
                       Selector  (xcpt_Space_Access)
                         -1      (xcpt_Limit_Access) }
  xcpt_Illegal_Instruction      = $C000001C;
  xcpt_Float_Denormal_Operand   = $C0000094;
  xcpt_Float_Divide_By_Zero     = $C0000095;
  xcpt_Float_Inexact_Result     = $C0000096;
  xcpt_Float_Invalid_Operation  = $C0000097;
  xcpt_Float_Overflow           = $C0000098;
  xcpt_Float_Stack_Check        = $C0000099;
  xcpt_Float_Underflow          = $C000009A;
  xcpt_Integer_Divide_By_Zero   = $C000009B;
  xcpt_Integer_Overflow         = $C000009C;
  xcpt_Privileged_Instruction   = $C000009D;
{  Portable fatal software generated exceptions }
  xcpt_In_Page_Error            = $C0000006;
{ ExceptionInfo[ 0 ] - FaultAddr }
  xcpt_Process_Terminate        = $C0010001;
  xcpt_Async_Process_Terminate  = $C0010002;
{ ExceptionInfo[ 0 ] - TID of 'terminator' thread }
  xcpt_NonContinuable_Exception = $C0000024;
  xcpt_Invalid_Disposition      = $C0000025;
{ Non-portable fatal exceptions }
  xcpt_Invalid_Lock_Sequence    = $C000001D;
  xcpt_Array_Bounds_Exceeded    = $C0000093;
  xcpt_B1npx_Errata_02          = $C0010004;
{ Misc exceptions }
  xcpt_Unwind                   = $C0000026;
  xcpt_Bad_Stack                = $C0000027;
  xcpt_Invalid_Unwind_Target    = $C0000028;
{ Signal Exceptions }
  xcpt_Signal                   = $C0010003;
{ ExceptionInfo[ 0 ] - Signal Number }

{ ContextRecord
  This is the machine specific register contents for the thread
  at the time of the exception. Note that only the register sets
  specified by ContextFlags contain valid data. Conversely, only
  registers specified in ContextFlags will be restored if an exception
  is handled.

  The following flags control the contents of the CONTEXT structure.
}
  context_Control               = $00000001;    { SS:ESP, CS:EIP, EFLAGS, EBP  }
  context_Integer               = $00000002;    { EAX, EBX, ECX, EDX, ESI, EDI }
  context_Segments              = $00000004;    { DS, ES, FS, GS               }
  context_Floating_Point        = $00000008;    { numeric coprocessor state    }
  context_Full                  = context_Control  or context_Integer or
                                  context_Segments or context_Floating_Point;
{ Coprocessor stack register element }
type
  PFpReg = ^FpReg;
  FpReg = record
    losig:   ULong;
    hisig:   ULong;
    signexp: SmallWord;
  end;

  PContextRecord = ^ContextRecord;
  ContextRecord = record
{ The flags values within this flag control the contents of
  a ContextRecord.
  If the ContextRecord is used as an input parameter, then
  for each portion of the ContextRecord controlled by a flag
  whose value is set, it is assumed that that portion of the
  ContextRecord contains valid context. If the ContextRecord
  is being used to modify a thread's context, then only that
  portion of the thread's context will be modified.

  If the ContextRecord is used as an Input/Output parameter to
  capture the context of a thread, then only those portions of the
  thread's context corresponding to set flags will be returned.
}
    ContextFlags: ULong;
{ This section is specified/returned if the ContextFlags
  contains the flag context_Floating_Point.
}
    ctx_env:   array [0..6] of ULong;    { coprocessor environment }
    ctx_stack: array [0..7] of FpReg;    { register set            }
{ This section is specified/returned if the ContextFlags
   contains the flag context_Segments.
}
    ctx_SegGs:  ULong;
    ctx_SegFs:  ULong;
    ctx_SegEs:  ULong;
    ctx_SegDs:  ULong;
{ This section is specified/returned if the ContextFlags
  contains the flag context_Integer.
}
    ctx_RegEdi: ULong;
    ctx_RegEsi: ULong;
    ctx_RegEax: ULong;
    ctx_RegEbx: ULong;
    ctx_RegEcx: ULong;
    ctx_RegEdx: ULong;
{ This section is specified/returned if the ContextFlags
  contains the flag context_Control.
}
    ctx_RegEbp: ULong;
    ctx_RegEip: ULong;
    ctx_SegCs:  ULong;
    ctx_EFlags: ULong;
    ctx_RegEsp: ULong;
    ctx_SegSs:  ULong;
  end;

{ ExceptionReportRecord
  This structure contains machine independant information about an
  exception/unwind. No system exception will ever have more than
  exception_Maximum_Parameters parameters. User exceptions are not
  bound to this limit.
 }
const
  exception_Maximum_Parameters  = 4;    { Enough for all system exceptions }
type
  PExceptionRegistrationRecord = ^ExceptionRegistrationRecord;
  PExceptionReportRecord = ^ExceptionReportRecord;
  ExceptionReportRecord = record
    ExceptionNum:     ULong;            { exception number }
    fHandlerFlags:    ULong;
    NestedExceptionReportRecord: PExceptionReportRecord;
    ExceptionAddress: Pointer;
    cParameters:      ULong;            { Size of Exception Specific Info }
    ExceptionInfo: array [0..exception_Maximum_Parameters-1] of ULong;
  end;                                  { Exception Specfic Info }

  Err = function(ExcpRep: PExceptionReportRecord;
                 ExcpReg: PExceptionRegistrationRecord;
                 Context: PContextRecord;
                 P:       Pointer): ULong;

{ ExceptionRegistrationRecord
  These are linked together to form a chain of exception handlers that
  will be dispatched to upon receipt of an exception.
}
  ExceptionRegistrationRecord = record
    Prev_Structure:   PExceptionRegistrationRecord;
    ExceptionHandler: Err;
  end;

{ End of exception chain marker }
const
  end_Of_Chain  = PExceptionRegistrationRecord(-1);

function DosSetExceptionHandler(var ERegRec: ExceptionRegistrationRecord): ApiRet;
function DosUnsetExceptionHandler(var ERegRec: ExceptionRegistrationRecord): ApiRet;
function DosRaiseException(var Xcpt: ExceptionReportRecord): ApiRet;
function DosSendSignalException(Pid: Pid; Exception: ULong): ApiRet;
function DosUnwindException(var Handler: ExceptionRegistrationRecord; TargetIP: Pointer;
  var ERepRec: ExceptionReportRecord): ApiRet;
function DosSetSignalExceptionFocus(Flag: Bool; var Times: ULong): ApiRet;
function DosEnterMustComplete(var Nesting: ULong): ApiRet;
function DosExitMustComplete(var Nesting: ULong): ApiRet;
function DosAcknowledgeSignalException(SignalNum: ULong): ApiRet;

{*** Pipe and queue support ***}

type
  PHQueue = ^HQueue;
  HQueue  = LHandle;

  PRequestData = ^RequestData;
  RequestData = record
    Pid:  Pid;
    Data: ULong;
  end;

const
  que_Fifo                      = 0;
  que_Lifo                      = 1;
  que_Priority                  = 2;
  que_NoConvert_Address         = 0;
  que_Convert_Address           = 4;

function DosCreatePipe(var Read,Write: HFile; cb: ULong): ApiRet;
function DosCloseQueue(Queue: HQueue): ApiRet;
function DosCreateQueue(var Queue: HQueue; Priority: ULong; Name: PChar): ApiRet;
function DosOpenQueue(var Pid: Pid; var Queue: HQueue; Name: PChar): ApiRet;
function DosPeekQueue(Queue: HQueue; var Request: RequestData; var cbData: ULong;
  var Buf; var Element: ULong; NoWait: ULong; var Priority: Byte; Sem: HEv): ApiRet;
function DosPurgeQueue(Queue: HQueue): ApiRet;
function DosQueryQueue(Queue: HQueue; var cbEntries: ULong): ApiRet;
function DosReadQueue(Queue: HQueue; var Request: RequestData;
  var cbData: ULong; var Buf; Element: ULong; NoWait: ULong; var Priority: Byte; Sem: HEv): ApiRet;
function DosWriteQueue(Queue: HQueue; Request: ULong; cbData: ULong; pbData: Pointer; Priority: ULong): ApiRet;

{ definitions for DosSearchPath control Word }
const
  dsp_ImpliedCur                = 1;    { current dir will be searched first }
  dsp_PathRef                   = 2;    { from env.variable }
  dsp_IgnoreNetErr              = 4;    { ignore net errs & continue search }

{ indices for DosQuerySysInfo }
  qsv_Max_Path_Length           = 1;
  q_Max_Path_Length             = qsv_Max_Path_Length;
  qsv_Max_Text_Sessions         = 2;
  qsv_Max_Pm_Sessions           = 3;
  qsv_Max_Vdm_Sessions          = 4;
  qsv_Boot_Drive                = 5;      { 1=A, 2=B, etc. }
  qsv_Dyn_Pri_Variation         = 6;      { 0=Absolute, 1=Dynamic }
  qsv_Max_Wait                  = 7;      { seconds }
  qsv_Min_Slice                 = 8;      { milli seconds }
  qsv_Max_Slice                 = 9;      { milli seconds }
  qsv_Page_Size                 = 10;
  qsv_Version_Major             = 11;
  qsv_Version_Minor             = 12;
  qsv_Version_Revision          = 13;     { Revision letter }
  qsv_Ms_Count                  = 14;     { Free running millisecond counter }
  qsv_Time_Low                  = 15;     { Low dWord of time in seconds }
  qsv_Time_High                 = 16;     { High dWord of time in seconds }
  qsv_TotPhysMem                = 17;     { Physical memory on system }
  qsv_TotResMem                 = 18;     { Resident memory on system }
  qsv_TotAvailMem               = 19;     { Available memory for all processes }
  qsv_MaxPrMem                  = 20;     { Avail private mem for calling proc }
  qsv_MaxShMem                  = 21;     { Avail shared mem for calling proc }
  qsv_Timer_Interval            = 22;     { Timer interval in tenths of ms }
  qsv_Max_Comp_Length           = 23;     { max len of one component in a name }
{ OS/2 3.0+ only }
  qsv_Foreground_Fs_Session     = 24;     { Session ID of current fgnd FS session }
  qsv_Foreground_Process        = 25;     { Process ID of current fgnd process }
  qsv_Max                       = qsv_Foreground_Process;
{ definitions for DosError - combine with OR }
  ferr_DisableHardErr           = $00000000;    { disable hard error popups }
  ferr_EnableHardErr            = $00000001;    { enable hard error popups  }
  ferr_EnableException          = $00000000;    { enable exception popups   }
  ferr_DisableException         = $00000002;    { disable exception popups  }
{ definitions for DosQueryRASInfo Index }
  sis_MmioAddr                  = 0;
  sis_Mec_Table                 = 1;
  sis_Sys_Log                   = 2;
{ definitions for DosQueryExtLIBPATH and DosSetExtLIBPATH flags parameter }
  Begin_Libpath                 = 1;
  End_Libpath                   = 2;

type
  PPChar = ^PChar;

function DosError(Error: ULong): ApiRet;
function DosGetMessage(Table: PPChar; cTable: ULong; Buf: PChar; cbBuf: ULong;
  MsgNumber: ULong; FileName: PChar; var cbMsg: ULong): ApiRet;
function DosErrClass(Code: ULong; var Cls,Action,Locus: ULong): ApiRet;
function DosInsertMessage(var Table: PChar; cTable: ULong; Msg: PChar; cbMsg: ULong;
  Buf: PChar; cbBuf: ULong; var cbMsg: ULong): ApiRet;
function DosPutMessage(F: HFile; cbMsg: ULong; Buf: PChar): ApiRet;
function DosQuerySysInfo(Start,Last: ULong; var Buf; cbBuf: ULong): ApiRet;
function DosScanEnv(Name: PChar; var Value: PChar): ApiRet;
function DosSearchPath(Flag: ULong; PathOrName,FileName,Buf: PChar; cbBuf: ULong): ApiRet;
function DosQueryMessageCP(pb: PChar; cb: ULong; FileName: PChar; var Buf: ULong): ApiRet;
function DosQueryRASInfo(Index: ULong; var Addr: Pointer): ApiRet;
function DosSetExtLIBPATH(ExtLIBPATH: PChar; Flags: ULong): ApiRet;
function DosQueryExtLIBPATH(ExtLIBPATH: PChar; Flags: ULong): ApiRet;

{ Session manager support }
type
  StartData = record
    Length:        SmallWord;
    Related:       SmallWord;
    FgBg:          SmallWord;
    TraceOpt:      SmallWord;
    PgmTitle:      PChar;
    PgmName:       PChar;
    PgmInputs:     PChar;
    TermQ:         PChar;
    Environment:   PChar;
    InheritOpt:    SmallWord;
    SessionType:   SmallWord;
    IconFile:      PChar;
    PgmHandle:     ULong;
    PgmControl:    SmallWord;
    InitXPos:      SmallWord;
    InitYPos:      SmallWord;
    InitXSize:     SmallWord;
    InitYSize:     SmallWord;
    Reserved:      SmallWord;
    ObjectBuffer:  PChar;
    ObjectBuffLen: ULong;
  end;

const
  ssf_Related_Independent       = 0;
  ssf_Related_Child             = 1;

  ssf_Fgbg_Fore                 = 0;
  ssf_Fgbg_Back                 = 1;

  ssf_TraceOpt_None             = 0;
  ssf_TraceOpt_Trace            = 1;
  ssf_TraceOpt_TraceAll         = 2;

  ssf_InhertOpt_Shell           = 0;
  ssf_InhertOpt_Parent          = 1;

{ note that these types are identical to those in PmShl unit for prog_* }
  ssf_Type_Default              = 0;
  ssf_Type_FullScreen           = 1;
  ssf_Type_WindowableVio        = 2;
  ssf_Type_Pm                   = 3;
  ssf_Type_Vdm                  = 4;
  ssf_Type_Group                = 5;
  ssf_Type_Dll                  = 6;
  ssf_Type_WindowedVdm          = 7;
  ssf_Type_Pdd                  = 8;
  ssf_Type_Vdd                  = 9;

{ note that these flags are identical to those in PmShl unit for she_* }
  ssf_Control_Visible           = $0000;
  ssf_Control_Invisible         = $0001;
  ssf_Control_Maximize          = $0002;
  ssf_Control_Minimize          = $0004;
  ssf_Control_NoAutoClose       = $0008;
  ssf_Control_SetPos            = $8000;

  prog_Default                  = 0;
  prog_FullScreen               = 1;
  prog_WindowableVIO            = 2;
  prog_PM                       = 3;
  prog_Group                    = 5;
  prog_Real                     = 4;
  prog_VDM                      = 4;
  prog_WindowedVDM              = 7;
  prog_DLL                      = 6;
  prog_PDD                      = 8;
  prog_VDD                      = 9;
  prog_Window_Real              = 10;
  prog_Window_Prot              = 11;
  prog_30_Std                   = 11;
  prog_Window_Auto              = 12;
  prog_SeamlessVDM              = 13;
  prog_30_StdSeamlessVDM        = 13;
  prog_SeamlessCommon           = 14;
  prog_30_StdSeamlessCommon     = 14;
  prog_31_StdSeamlessVDM        = 15;
  prog_31_StdSeamlessCommon     = 16;
  prog_31_EnhSeamlessVDM        = 17;
  prog_31_EnhSeamlessCommon     = 18;
  prog_31_Enh                   = 19;
  prog_31_Std                   = 20;
  prog_Reserved                 = 255;

type
  PStatusData = ^StatusData;
  StatusData = record
    Length:    SmallWord;
    SelectInd: SmallWord;
    BondInd:   SmallWord;
  end;

{ SelectInd and BondInd paramater values for DosSetSession }
const
  set_Session_Unchanged         = 0;
  set_Session_Selectable        = 1;
  set_Session_Non_Selectable    = 2;
  set_Session_Bond              = 1;
  set_Session_No_Bond           = 2;
{ TargetOption (scope) parameter values for DosStopSession }
  stop_Session_Specified        = 0;
  stop_Session_All              = 1;

function DosStartSession(var Sd: StartData; var IdSession: ULong; var Pid: Pid): ApiRet;
function DosSetSession(IdSession: ULong; var Sd: StatusData): ApiRet;
function DosSelectSession(IdSession: ULong): ApiRet;
function DosStopSession(Scope: ULong; IdSession: ULong): ApiRet;
function DosQueryAppType(Name: PChar; var Flags: ULong): ApiRet;

{ AppType returned in by DosQueryAppType in pFlags as follows }
const
  fapptyp_NotSpec               = $0000;
  fapptyp_NotWindowCompat       = $0001;
  fapptyp_WindowCompat          = $0002;
  fapptyp_WindowApi             = $0003;
  fapptyp_Bound                 = $0008;
  fapptyp_Dll                   = $0010;
  fapptyp_Dos                   = $0020;
  fapptyp_PhysDrv               = $0040; { physical device driver       }
  fapptyp_VirtDrv               = $0080; { virtual device driver        }
  fapptyp_ProtDll               = $0100; { 'protected memory' dll       }
  fapptyp_WindowsReal           = $0200; { Windows real mode app        }
  fapptyp_WindowsProt           = $0400; { Windows protect mode app     }
  fapptyp_32bit                 = $4000;
  fapptyp_ExeType               = fapptyp_WindowApi;

  fapptyp_Reserved              =
    not (fapptyp_WindowApi or fapptyp_Bound or fapptyp_Dll or fapptyp_Dos or
         fapptyp_PhysDrv or fapptyp_VirtDrv or fapptyp_ProtDll or fapptyp_32bit);

  eat_apptyp_PmApi              = $00;           { Uses PM API }
  eat_apptyp_Dos                = $01;           { DOS APP }
  eat_apptyp_PmW                = $02;           { Window compatible }
  eat_apptyp_NoPmW              = $03;           { Not Window compatible }
  eat_apptyp_ExeType            = $03;           { EXE type mask }
  eat_apptyp_Reserved           = not eat_apptyp_ExeType;

{ Device support }

function DosDevConfig(DevInfo: Pointer; Item: ULong): ApiRet;

const
  devinfo_Printer               = 0;      { Number of printers attached }
  devinfo_Rs232                 = 1;      { Number of RS232 ports }
  devinfo_Floppy                = 2;      { Number of diskette drives }
  devinfo_Coprocessor           = 3;      { Presence of math coprocessor }
  devinfo_SubModel              = 4;      { PC Submodel Type }
  devinfo_Model                 = 5;      { PC Model Type }
  devinfo_Adapter               = 6;      { Primary display adapter type }

function DosDevIOCtl(Device: HFile; Category,Func: ULong; Params: Pointer;
  cbParmLenMax: ULong; cbParmLen: PULong; Data: Pointer; cbDataLenMax: ULong;
  cbDataLen: PULong): ApiRet;

{ OS/2 Structures and constants for use with DosDevIOCtl }

{ Input and Output Control Categories }

const
  ioctl_Async                   = $0001;
  ioctl_Scr_and_PtrDraw         = $0003;
  ioctl_Keyboard                = $0004;
  ioctl_Printer                 = $0005;
  ioctl_LightPen                = $0006;
  ioctl_PointingDevice          = $0007;
  ioctl_Disk                    = $0008;
  ioctl_PhysicalDisk            = $0009;
  ioctl_Monitor                 = $000A;
  ioctl_General                 = $000B;
  ioctl_Power                   = $000C;
  ioctl_OemHlp                  = $0080;
  ioctl_TestCfg_Sys             = $0080;
  ioctl_CdromDisk               = $0080;
  ioctl_CdromAudio              = $0081;
  ioctl_Touch_DevDep            = $0081;
  ioctl_Touch_DevIndep          = $0081;

{ Serial-Device Control }

  async_SetBaudRate             = $0041;
  async_SetLineCtrl             = $0042;
  async_ExtSetBaudRate          = $0043;
  async_TransmitImm             = $0044;
  async_SetBreakOff             = $0045;
  async_SetModemCtrl            = $0046;
  async_SetBreakOn              = $004B;
  async_StopTransmit            = $0047;
  async_StartTransmit           = $0048;
  async_SetDcbInfo              = $0053;
  async_SetEnhancedModeParms    = $0054;
  async_GetBaudRate             = $0061;
  async_GetLineCtrl             = $0062;
  async_ExtGetBaudRate          = $0063;
  async_GetCommStatus           = $0064;
  async_GetLineStatus           = $0065;
  async_GetModemOutput          = $0066;
  async_GetModemInput           = $0067;
  async_GetInQueCount           = $0068;
  async_GetOutQueCount          = $0069;
  async_GetCommError            = $006D;
  async_GetCommEvent            = $0072;
  async_GetDcbInfo              = $0073;
  async_GetEnhancedModeParms    = $0074;

{ Screen/Pointer-Draw Control }

  scr_AllocLdt                  = $0070;
  scr_DeallocLdt                = $0071;
  ptr_GetPtrDrawAddress         = $0072;
  vid_InitCallVector            = $0073;
  scr_ABiosPassThru             = $0074;
  scr_AllocLdtOff               = $0075;
  scr_AllocLdtBgVal             = $0076;
  scr_AllocVideoBuffer          = $007E;
  scr_GetRomFontAddr            = $007F;

{ Keyboard Control }

  kbd_SetTransTable             = $0050;
  kbd_SetInputMode              = $0051;
  kbd_SetInterimFlag            = $0052;
  kbd_SetShiftState             = $0053;
  kbd_SetTypamaticRate          = $0054;
  kbd_SetFgndScreenGrp          = $0055;
  kbd_SetSesMgrHotKey           = $0056;
  kbd_SetFocus                  = $0057;
  kbd_SetKcb                    = $0058;
  kbd_SetReadNotification       = $0059;
  kbd_AlterKbdLed               = $005A;
  kbd_SetNls                    = $005C;
  kbd_Create                    = $005D;
  kbd_Destroy                   = $005E;
  kbd_GetInputMode              = $0071;
  kbd_GetInterimFlag            = $0072;
  kbd_GetShiftState             = $0073;
  kbd_ReadChar                  = $0074;
  kbd_PeekChar                  = $0075;
  kbd_GetSesMgrHotKey           = $0076;
  kbd_GetKeybdType              = $0077;
  kbd_GetCodePageId             = $0078;
  kbd_XlateScan                 = $0079;
  kbd_QueryKbdHardwareId        = $007A;
  kbd_QueryKbdCodePageSupport   = $007B;

{ Printer Control }

  prt_QueryJobHandle            = $0021;
  prt_SetFrameCtl               = $0042;
  prt_SetInfiniteRetry          = $0044;
  prt_InitPrinter               = $0046;
  prt_ActivateFont              = $0048;
  prt_SetPrintJobTitle          = $004D;
  prt_SetIrqTimeout             = $004E;
  prt_GetFrameCtl               = $0062;
  prt_GetInfiniteRetry          = $0064;
  prt_GetPrinterStatus          = $0066;
  prt_QueryActiveFont           = $0069;
  prt_VerifyFont                = $006A;
  prt_QueryIrqTimeout           = $006E;

{ Pointing-Device (Mouse) Control }

  mou_AllowPtrDraw              = $0050;
  mou_UpdateDisplayMode         = $0051;
  mou_ScreenSwitch              = $0052;
  mou_SetScaleFactors           = $0053;
  mou_SetEventMask              = $0054;
  mou_SetHotKeyButton           = $0055;
  mou_ReassignThresholdValues   = $0055;
  mou_SetPtrShape               = $0056;
  mou_DrawPtr                   = $0057;
  mou_UnmarkCollisionArea       = $0057;
  mou_RemovePtr                 = $0058;
  mou_MarkCollisionArea         = $0058;
  mou_SetPtrPos                 = $0059;
  mou_SetProtDrawAddress        = $005A;
  mou_SetRealDrawAddress        = $005B;
  mou_SetMouStatus              = $005C;
  mou_DisplayModeChange         = $005D;
  mou_GetButtonCount            = $0060;
  mou_GetMickeyCount            = $0061;
  mou_GetMouStatus              = $0062;
  mou_ReadEventQue              = $0063;
  mou_GetQueStatus              = $0064;
  mou_GetEventMask              = $0065;
  mou_GetScaleFactors           = $0066;
  mou_GetPtrPos                 = $0067;
  mou_GetPtrShape               = $0068;
  mou_GetHotKeyButton           = $0069;
  mou_QueryThresholdValues      = $0069;
  mou_Ver                       = $006A;
  mou_QueryPointerId            = $006B;

{ Disk/Diskette Control }

  dsk_LockDrive                 = $0000;
  dsk_UnlockDrive               = $0001;
  dsk_RedetermineMedia          = $0002;
  dsk_SetLogicalMap             = $0003;
  dsk_BeginFormat               = $0004;
  dsk_BlockRemovable            = $0020;
  dsk_GetLogicalMap             = $0021;
  dsk_UnlockEjectMedia          = $0040;
  dsk_SetDeviceParams           = $0043;
  dsk_WriteTrack                = $0044;
  dsk_FormatVerify              = $0045;
  dsk_DisketteControl           = $005D;
  dsk_QueryMediaSense           = $0060;
  dsk_GetDeviceParams           = $0063;
  dsk_ReadTrack                 = $0064;
  dsk_VerifyTrack               = $0065;
  dsk_GetLockStatus             = $0066;

{ Physical-Disk Control }

  pdsk_LockPhysDrive            = $0000;
  pdsk_UnlockPhysDrive          = $0001;
  pdsk_WritePhysTrack           = $0044;
  pdsk_GetPhysDeviceParams      = $0063;
  pdsk_ReadPhysTrack            = $0064;
  pdsk_VerifyPhysTrack          = $0065;

{ Character-Monitor Control }
  mon_RegisterMonitor           = $0040;

{ General Device Control }

  dev_FlushInput                = $0001;
  dev_FlushOutput               = $0002;
  dev_SystemNotifyPdd           = $0041;
  dev_QueryMonSupport           = $0060;

{ Advanced Power Management }

  power_SendPowerEvent          = $0040;
  power_SetPowerEventRes        = $0041;
  power_GetPowerStatus          = $0060;
  power_GetPowerEvent           = $0061;
  power_GetPowerInfo            = $0062;

{ OEMHlp }

  oemhlp_GetOemAdaptionInfo     = $0000;
  oemhlp_GetMachineInfo         = $0001;
  oemhlp_GetDisplayCombCode     = $0002;
  oemhlp_GetVideoFonts          = $0003;
  oemhlp_ReadEisaConfigInfo     = $0004;
  oemhlp_GetRomBiosInfo         = $0005;
  oemhlp_GetMiscVideoInfo       = $0006;
  oemhlp_GetVideoAdapter        = $0007;
  oemhlp_GetSvgaInfo            = $0008;
  oemhlp_GetMemInfo             = $0009;
  oemhlp_GetDmqsInfo            = $000A;
  oemhlp_Pci                    = $000B;

 { Test System Config }

  testcfg_Sys_GetBiosAdapter    = $0040;
  testcfg_Sys_IssueInIoInstr    = $0041;
  testcfg_Sys_IssueOutIoInstr   = $0042;
  testcfg_Sys_GetBusArch        = $0060;
  testcfg_Sys_GetAllPosIds      = $0061;
  testcfg_Sys_GetAllEisaIds     = $0062;

{ CDROM Drive and Disk }

  cdromdisk_ResetDrive          = $0040;
  cdromdisk_EjectDisk           = $0044;
  cdromdisk_CloseTray           = $0045;
  cdromdisk_LockUnlockDoor      = $0046;
  cdromdisk_Seek                = $0050;
  cdromdisk_DeviceStatus        = $0060;
  cdromdisk_GetDriver           = $0061;
  cdromdisk_GetSectorSize       = $0063;
  cdromdisk_GetHeadLoc          = $0070;
  cdromdisk_ReadLong            = $0072;
  cdromdisk_GetVolumeSize       = $0078;
  cdromdisk_GetUpc              = $0079;

{ CDROM Audio }

  cdromaudio_SetChannelCtrl     = $0040;
  cdromaudio_PlayAudio          = $0050;
  cdromaudio_StopAudio          = $0051;
  cdromaudio_ResumeAudio        = $0052;
  cdromaudio_GetChannel         = $0060;
  cdromaudio_GetAudioDisk       = $0061;
  cdromaudio_GetAudioTrack      = $0062;
  cdromaudio_GetSubChannelQ     = $0063;
  cdromaudio_GetAudioStatus     = $0065;

{ Touch device-dependent IOCtls }

  touch_DevDep_SetCalibConst    = $0052;
  touch_DevDep_ReadData         = $0053;
  touch_DevDep_SetDataMode      = $0054;
  touch_DevDep_SetClickLock     = $0055;
  touch_DevDep_SetTouchThreshold = $0056;
  touch_DevDep_SetEmulXy        = $0057;
  touch_DevDep_SetDataReportRate = $0058;
  touch_DevDep_SetLowPassFilter = $0059;
  touch_DevDep_WriteMemLoc      = $005A;
  touch_DevDep_GetCalibConst    = $0060;
  touch_DevDep_GetDataMode      = $0061;
  touch_DevDep_GetClickLock     = $0062;
  touch_DevDep_GetTouchThreshold = $0063;
  touch_DevDep_GetEmulXy        = $0064;
  touch_DevDep_GetDataReportRate = $0065;
  touch_DevDep_GetLowPassFilter = $0066;
  touch_DevDep_ReadMemLoc       = $0067;

{ Touch device-INdependent IOCtls }

  touch_DevIndep_SetCoordSys    = $0050;
  touch_DevIndep_SetSelectMech  = $0052;
  touch_DevIndep_SetEventMask   = $0053;
  touch_DevIndep_SetQueueSize   = $0054;
  touch_DevIndep_SetEmulState   = $0055;
  touch_DevIndep_GetCoordSys    = $0060;
  touch_DevIndep_GetSelectMech  = $0062;
  touch_DevIndep_GetEventMask   = $0063;
  touch_DevIndep_GetQueueSize   = $0064;
  touch_DevIndep_GetEmulState   = $0065;
  touch_DevIndep_GetReadEventQueue = $0066;

{ async_GetCommError, async_SetBreakOff, async_SetBreakOn, async_SetModemCtrl }
  rx_Que_Overrun                = $0001;
  rx_Hardware_Overrun           = $0002;
  parity_Error                  = $0004;
  framing_Error                 = $0008;

{ async_GetCommEvent }
  char_Received                 = $0001;
  last_Char_Sent                = $0004;
  cts_Changed                   = $0008;
  dsr_Changed                   = $0010;
  dcd_Changed                   = $0020;
  break_Detected                = $0040;
  error_Occurred                = $0080;
  ri_Detected                   = $0100;

{ async_GetCommStatus }
  tx_Waiting_For_Cts            = $0001;
  tx_Waiting_For_Dsr            = $0002;
  tx_Waiting_For_Dcd            = $0004;
  tx_Waiting_For_Xon            = $0008;
  tx_Waiting_To_Send_Xon        = $0010;
  tx_Waiting_While_Break_On     = $0020;
  tx_Waiting_To_Send_Imm        = $0040;
  rx_Waiting_For_Dsr            = $0080;

{ async_GetLineStatus }
  write_Request_Queued          = $0001;
  data_In_Tx_Que                = $0002;
  hardware_Transmitting         = $0004;
  char_Ready_To_Send_Imm        = $0008;
  waiting_To_Send_Xon           = $0010;
  waiting_To_Send_Xoff          = $0020;

{ async_GetModemInput }
  cts_On                        = $10;
  dsr_On                        = $20;
  ri_On                         = $40;
  dcd_On                        = $80;

{ dsk_SetDeviceParams }
  build_Bpb_From_Medium         = $00;
  replace_Bpb_For_Device        = $01;
  replace_Bpb_For_Medium        = $02;

{ kbd_GetInputMode, kbd_PeekChar, kbd_SetInputMode }
  ascii_Mode                    = $00;
  binary_Mode                   = $80;

{ kbd_GetInterimFlag }
  conversion_Request            = $20;
  interim_Char                  = $80;

{ kbd_GetSesMgrHotKey }
  hotkey_Max_Count              = $0000;
  hotkey_Current_Count          = $0001;

{ kbd_PeekChar }
  kbd_Data_Received             = $0001;
  kbd_Data_Binary               = $8000;

{ kbd_ReadChar }
  kbd_Read_Wait                 = $0000;
  kbd_Read_NoWait               = $8000;

{ kbd_SetInputMode }
  shift_Report_Mode             = $01;

{ mou_GetHotKeyButton, mou_SetHotKeyButton }
  mhk_No_HotKey                 = $0000;

{ PRT_GETPRINTERSTATUS }
  printer_Timeout               = $0001;
  printer_Io_Error              = $0008;
  printer_Selected              = $0010;
  printer_Out_Of_Paper          = $0020;
  printer_Acknowledged          = $0040;
  printer_Not_Busy              = $0080;

{ fbCtlHndShake }
  mode_Dtr_Control              = $01;
  mode_Dtr_Handshake            = $02;
  mode_Cts_Handshake            = $08;
  mode_Dsr_Handshake            = $10;
  mode_Dcd_Handshake            = $20;
  mode_Dsr_Sensitivity          = $40;

{ fbFlowReplace }
  mode_Auto_Transmit            = $01;
  mode_Auto_Receive             = $02;
  mode_Error_Char               = $04;
  mode_Null_Stripping           = $08;
  mode_Break_Char               = $10;
  mode_Rts_Control              = $40;
  mode_Rts_Handshake            = $80;
  mode_Transmit_Toggle          = $C0;

{ fbTimeout }
  mode_No_Write_Timeout         = $01;
  mode_Read_Timeout             = $02;
  mode_Wait_Read_Timeout        = $04;
  mode_NoWait_Read_Timeout      = $06;

type
  PDcbInfo = ^DcbInfo;
  DcbInfo = record
    usWriteTimeout:        SmallWord;
    usReadTimeout:         SmallWord;
    fbCtlHndShake:         Byte;
    fbFlowReplace:         Byte;
    fbTimeout:             Byte;
    bErrorReplacementChar: Byte;
    bBreakReplacementChar: Byte;
    bXONChar:              Byte;
    bXOFFChar:             Byte;
  end;

  PTrackLayout = ^TrackLayout;
  TrackLayout = record
    bCommand:      Byte;
    usHead:        SmallWord;
    usCylinder:    SmallWord;
    usFirstSector: SmallWord;
    cSectors:      SmallWord;
    TrackTable: array[0..0] of record
      usSectorNumber: SmallWord;
      usSectorSize:   SmallWord;
    end;
  end;

const
  devtype_48TPI                 = $0000;
  devtype_96TPI                 = $0001;
  devtype_35                    = $0002;
  devtype_8SD                   = $0003;
  devtype_8DD                   = $0004;
  devtype_Fixed                 = $0005;
  devtype_Tape                  = $0006;
  devtype_Unknown               = $0007;

type
  PBiosParameterBlock = ^BiosParameterBlock;
  BiosParameterBlock = record
    usBytesPerSector:   SmallWord;
    bSectorsPerCluster: Byte;
    usReservedSectors:  SmallWord;
    cFATs:              Byte;
    cRootEntries:       SmallWord;
    cSectors:           SmallWord;
    bMedia:             Byte;
    usSectorsPerFAT:    SmallWord;
    usSectorsPerTrack:  SmallWord;
    cHeads:             SmallWord;
    cHiddenSectors:     ULong;
    cLargeSectors:      ULong;
    abReserved: array[0..5] of Byte;
    cCylinders:         SmallWord;
    bDeviceType:        Byte;
    fsDeviceAttr:       SmallWord;
  end;

  PScreenGroup = ^ScreenGroup;
  ScreenGroup = record
    idScreenGrp: SmallWord;
    fTerminate:  SmallWord;
  end;

  PFrame = ^Frame;
  Frame = record
    bCharsPerLine: Byte;
    bLinesPerInch: Byte;
  end;

  PKbdType = ^KbdType;
  KbdType = record
    usType:    SmallWord;
    reserved1: SmallWord;
    reserved2: SmallWord;
  end;

  PLineControl = ^LineControl;
  LineControl = record
    bDataBits:   Byte;
    bParity:     Byte;
    bStopBits:   Byte;
    fTransBreak: Byte;
  end;

{ ModemStatus.fbModemOn, async_GetModemOutput }
const
  dtr_On                        = $01;
  rts_On                        = $02;

{ ModemStatus.fbModemOff }
  dtr_Off                       = $FE;
  rts_Off                       = $FD;

type
  PModemStatus = ^ModemStatus;
  ModemStatus = record
    fbModemOn:  Byte;
    fbModemOff: Byte;
  end;

  PTrackFormat = ^TrackFormat;
  TrackFormat = record
    bCommand:   Byte;
    usHead:     SmallWord;
    usCylinder: SmallWord;
    usReserved: SmallWord;
    cSectors:   SmallWord;
    FormatTable: array [0..0] of record
      bCylinder:    Byte;
      bHead:        Byte;
      idSector:     Byte;
      bBytesSector: Byte;
    end;
  end;

  PRxQueue = ^RxQueue;
  RxQueue = record
    cch: SmallWord;
    cb:  SmallWord;
  end;

  PDeviceParameterBlock = ^DeviceParameterBlock;
  DeviceParameterBlock = record
    reserved1:        SmallWord;
    cCylinders:       SmallWord;
    cHeads:           SmallWord;
    cSectorsPerTrack: SmallWord;
    reserved2:        SmallWord;
    reserved3:        SmallWord;
    reserved4:        SmallWord;
    reserved5:        SmallWord;
  end;

  PPtrDrawFunction = ^PtrDrawFunction;
  PtrDrawFunction = record
    usReturnCode:     SmallWord;
    pfnDraw:          PFn;
    pchDataSeg:       PChar;
  end;

  PPtrDrawAddress = ^PtrDrawAddress;
  PtrDrawAddress = record
    reserved: SmallWord;
    ptrdfnc:  PtrDrawFunction;
  end;

  PShiftState = ^ShiftState;
  ShiftState = record
    fsState: SmallWord;
    fNLS:    Byte;
  end;

{ HotKey.fsHotKey/ShiftState.fsState }
const
  RightShift                    = $0001;
  LeftShift                     = $0002;
  Control                       = $0004;
  Alt                           = $0008;
  ScrollLock_On                 = $0010;
  NumLock_On                    = $0020;
  CapsLock_On                   = $0040;
  Insert_On                     = $0080;
  LeftControl                   = $0100;
  LeftAlt                       = $0200;
  RightControl                  = $0400;
  RightAlt                      = $0800;
  ScrollLock                    = $1000;
  NumLock                       = $2000;
  CapsLock                      = $4000;
  SysReq                        = $8000;

type
  PHotKey = ^HotKey;
  HotKey = record
    fsHotKey:         SmallWord;
    uchScancodeMake:  Byte;
    uchScancodeBreak: Byte;
    idHotKey:         SmallWord;
  end;

  PMonitorPosition = ^MonitorPosition;
  MonitorPosition = record
    fPosition: SmallWord;
    index:     SmallWord;
    pbInBuf:   ULong;
    offOutBuf: SmallWord;
  end;

  PRateDelay = ^RateDelay;
  RateDelay = record
    usDelay: SmallWord;
    usRate:  SmallWord;
  end;

  PCodePageInfo = ^CodePageInfo;
  CodePageInfo = record
    pbTransTable: Pointer;
    idCodePage:   SmallWord;
    idTable:      SmallWord;
  end;

  PCpId = ^CpId;
  CpId = record
    idCodePage: SmallWord;
    Reserved:   SmallWord;
  end;

  PLdtAddrInfo = ^LdtAddrInfo;
  LdtAddrInfo = record
    pulPhysAddr: PULong;
    cb:          SmallWord;
  end;

  PPtrDrawData = ^PtrDrawData;
  PtrDrawData = record
    cb:       SmallWord;
    usConfig: SmallWord;
    usFlag:   SmallWord;
  end;

{ ScreenDd IoCtl definitions  }
const
  screendd_GetCurrentBank       = $00;   { Get current bank }
  screendd_SetCurrentBank       = $01;   { Set current bank }
  screendd_Svga_Id              = $08;   { Get SVGA info IOCTL }
  screendd_Svga_Oem             = $09;   { Get OEM info IOCTL }
  screendd_UpdateMemory         = $0A;   { Update Memory    IoCtl }
  screendd_GetLinearAccess      = $0B;   { GetLinearAccess  IoCtl }
  screendd_GetGlobalAccess      = $0C;   { GetGlobalAccess  IoCtl }
  screendd_FreeGlobalAccess     = $0D;   { FreeGlobalAccess IoCtl }
  screendd_Register_Ring0_Caller = $0E;  { Register VVID as Ring0 PMI caller }
  screendd_Wait_On_Ring0_Caller = $0F;   { Wait for RING0 caller to register }
  screendd_Category             = $80;
  screendd_Name                 = 'SCREEN$';

  getlinear_Flag_MapPhysical    = $00000010;
  getlinear_Flag_MapProcess     = $00000020;
  getlinear_Flag_MapShared      = $00000400;
  getlinear_Flag_MapAttach      = $80000000;

  Ega_Bit                       = 4;
  Vga_Bit                       = 8;
  EgaVga_Bit                    = Ega_Bit+Vga_Bit;

{ screendd_GetLinearAccess }
type
  PGetLinIoCtlData = ^GetLinIoCtlData;
  GetLinIoCtlData = record
    PacketLength:    ULong;
    PhysicalAddress: ULong;
    ApertureSize:    ULong;
    LinearAddress:   Pointer;
    LinearFlags:     ULong;
  end;

{  screendd_SetCurrentBank/GetCurrentBank }

PBankInfo = ^BankInfo;
BankInfo = record
  ulBankLength:    ULong;
  usBank:          SmallWord;
  usVideoModeType: SmallWord;
  usReadWriteMode: SmallWord;
end;

const
  read_Bank                     = 0;
  write_Bank                    = 1;
  mode_Text                     = 0;
  mode_Planar                   = 1;
  mode_Linear                   = 2;

{ screendd_GetGlobalAccess }
type
  PGlobalIoCtlData = ^GlobalIoCtlData;
  GlobalIoCtlData = record
    ProcessAddress: ULong;
    AddressLength:  ULong;
    GlobalAddress:  ULong;
  end;

{ data packet for screendd_Svga_Id }
  POemSvgaInfo = ^OemSvgaInfo;
  OemSvgaInfo = record
    AdapterType: SmallWord;
    ChipType:    SmallWord;
    Memory:      ULong;
  end;

{ data packet for screendd_Svga_Oem }

{ OEM data packet format must contain total length in bytes as its first Word. }
{ The rest of it can be in manufacturer/adapter specific format. }

  POemInfo = ^OemInfo;
  OemInfo = record
    OEMLength:        ULong;
    Manufacturer:     SmallWord;
    ManufacturerData: ULong;
  end;

{ paramter packet for GetGlobalAccess }

  PGetGlobalPacket = ^GetGlobalPacket;
  GetGlobalPacket = record
    GlobalPktLength: ULong;
    GlobalPktData: array[0..0] of GlobalIoCtlData;
  end;

function DosPhysicalDisk(Func: ULong; Buf: Pointer; cbBuf: ULong; Params: Pointer;
  cbParams: ULong): ApiRet;

const
  info_Count_Partitionable_Disks = 1;   { # of partitionable disks }
  info_GetIoctlHandle            = 2;   { Obtain handle            }
  info_FreeIoctlHandle           = 3;   { Release handle           }

{ DosNamedPipes API Support }
{ Data structures used with named pipes }

type
  PHPipe = ^HPipe;
  HPipe  = LHandle;

  PAvailData = ^AvailData;
  AvailData = record
    cbpipe:    SmallWord;               { bytes left in the pipe }
    cbmessage: SmallWord;               { bytes left in the current message }
  end;

  PPipeInfo = ^PipeInfo;
  PipeInfo = record
    cbOut:     SmallWord;          { length of outgoing I/O buffer }
    cbIn:      SmallWord;          { length of incoming I/O buffer }
    cbMaxInst: Byte;               { maximum number of instances   }
    cbCurInst: Byte;               { current number of instances   }
    cbName:    Byte;               { length of pipe name           }
    szName: array [0..0] of Char;  { start of name                 }
  end;

  PPipeSemState = ^PipeSemState;
  PipeSemState = record
    fStatus: Byte;          { type of record, 0 = EOI, 1 = read ok, }
                            { 2 = write ok, 3 = pipe closed         }
    fFlag:   Byte;          { additional info, 01 = waiting thread  }
    usKey:   SmallWord;     { user's key value                      }
    usAvail: SmallWord;     { available data/space if status = 1/2  }
  end;

const
  np_Indefinite_Wait            = -1;
  np_Default_Wait               =  0;
{ DosPeekNmPipe pipe states }
  np_State_Disconnected         = $0001;
  np_State_Listening            = $0002;
  np_State_Connected            = $0003;
  np_State_Closing              = $0004;
{ DosCreateNPipe open modes }
  np_Access_InBound             = $0000;
  np_Access_OutBound            = $0001;
  np_Access_Duplex              = $0002;
  np_Inherit                    = $0000;
  np_NoInherit                  = $0080;
  np_WriteBehind                = $0000;
  np_NoWriteBehind              = $4000;
{ DosCreateNPipe and DosQueryNPHState state }
  np_ReadMode_Byte              = $0000;
  np_ReadMode_Message           = $0100;
  np_Type_Byte                  = $0000;
  np_Type_Message               = $0400;
  np_End_Client                 = $0000;
  np_End_Server                 = $4000;
  np_Wait                       = $0000;
  np_NoWait                     = $8000;
  np_UnLimited_Instances        = $00FF;

function DosCallNPipe(Name: PChar; var InBuf; cbIn: ULong; var OutBuf;
  cbOut: ULong; var cbActual: ULong; MSec: ULong): ApiRet;
function DosConnectNPipe(Pipe: HPipe): ApiRet;
function DosDisConnectNPipe(Pipe: HPipe): ApiRet;
function DosCreateNPipe(Name: PChar; var Pipe: HPipe; OpenMode,PipeMode,cbInBuf,cbOutbuf,MSec: ULong): ApiRet;
function DosPeekNPipe(Pipe: HPipe; var Buf; cbBuf: ULong; var cbActual: ULong;
  var Avail: AvailData; var State: ULong): ApiRet;
function DosQueryNPHState(Pipe: HPipe; var State: ULong): ApiRet;
function DosQueryNPipeInfo(Pipe: HPipe; InfoLevel: ULong; var Buf; cbBuf: ULong): ApiRet;
function DosQueryNPipeSemState(Sem: HSem; var NpSS: PipeSemState; cbBuf: ULong): ApiRet;
function DosRawReadNPipe(Name: PChar; cb: ULong; var Len: ULong; var Buf): ApiRet;
function DosRawWriteNPipe(Name: PChar; cb: ULong): ApiRet;
function DosSetNPHState(Pipe: HPipe; State: ULong): ApiRet;
function DosSetNPipeSem(Pipe: HPipe; Sem: HSem; Key: ULong): ApiRet;
function DosTransactNPipe(Pipe: HPipe; var OutBuf; cbOut: ULong; var InBuf;
  cbIn: ULong; cbRead: ULong): ApiRet;
function DosWaitNPipe(Name: PChar; MSec: ULong): ApiRet;

{ values in fStatus }
const
  npss_EOI                      = 0;    { End Of Information    }
  npss_RData                    = 1;    { read data available   }
  npss_WSpace                   = 2;    { write space available }
  npss_Close                    = 3;    { pipe in Closing state }

{ values in npss_flag }
  npss_Wait                     = $01;  { waiting thread on end of pipe }
{ defined bits in pipe mode }
  np_NBlk                       = $8000;{ non-blocking read/write }
  np_Server                     = $4000;{ set if server end       }
  np_WMesg                      = $0400;{ write messages          }
  np_RMesg                      = $0100;{ read as messages        }
  np_ICount                     = $00FF;{ instance count field    }
{ Named pipes may be in one of several states depending on the actions
  that have been taken on it by the server end and client end.  The
  following state/action table summarizes the valid state transitions:
  Current state           Action                  Next state

   <none>             server DosMakeNmPipe        DISCONNECTED
   DISCONNECTED       server connect              LISTENING
   LISTENING          client open                 CONNECTED
   CONNECTED          server disconn              DISCONNECTED
   CONNECTED          client close                CLOSING
   CLOSING            server disconn              DISCONNECTED
   CONNECTED          server close                CLOSING
   <any other>        server close                <pipe deallocated>

  If a server disconnects his end of the pipe, the client end will enter a
  special state in which any future operations (except close) on the file
  descriptor associated with the pipe will return an error.
}

{ Values for named pipe state }
  np_DisConnected               = 1;        { after pipe creation or Disconnect }
  np_Listening                  = 2;        { after DosNmPipeConnect            }
  np_Connected                  = 3;        { after Client open                 }
  np_Closing                    = 4;        { after Client or Server close      }
{ DosProfile API support }
{ Perfview API support   }
function DosTmrQueryFreq(var TmrFreq: ULong): ApiRet;
function DosTmrQueryTime(var TmrTime: QWord): ApiRet;
function DosRegisterPerfCtrs(DataBlk,TextBlk: Pointer; Flags: ULong): ApiRet;
{ DosProfile ordinal number }
const
  prof_Ordinal                  = 133;
{ DosProfile usType }
  prof_System                   = 0;
  prof_User                     = 1;
  prof_Usedd                    = 2;
  prof_Kernel                   = 4;
  prof_Verbose                  = 8;
  prof_Enable                   = 16;
{ DosProfile usFunc }
  prof_Alloc                    = 0;
  prof_Clear                    = 1;
  prof_On                       = 2;
  prof_Off                      = 3;
  prof_Dump                     = 4;
  prof_Free                     = 5;
{ DosProfile tic count granularity (DWord) }
  prof_Shift                    = 2;
{ DosProfile module name string length }
  prof_Mod_Name_Size            = 10;
{ DosProfile error code for end of data }
  prof_End_Of_Data              = 13;
{ Virtual DOS Machine API support }
type
  PHVdd = ^HVdd;
  HVdd = LHandle;

function DosOpenVDD(VDD: PChar; var Vdd: HVdd): ApiRet;
function DosRequestVDD(VDD: HVdd; Sgid: Sgid; Cmd: ULong; cbInput: ULong;
  Input: Pointer; cbOutput: ULong; Output: Pointer): ApiRet;
function DosCloseVDD(Vdd: HVdd): ApiRet;
function DosQueryDOSProperty(Sgid: Sgid; Name: PChar; cb: ULong; pch: PChar): ApiRet;
function DosSetDOSProperty(gid: Sgid; Name: PChar; cb: ULong; pch: PChar): ApiRet;

function DosSuppressPopUps(Flag: ULong; Ch: Char): ApiRet;

{ Undocumented OS/2 routines that perform pointer conversion    }
{ NOTE: These routines can be called from BASM code only        }
{ EXPECTS:      eax     = Source pointer value                  }
{ RETURNS:      eax     = Converted pointer value               }
{ Instead of calling these routines directly, use System unit   }
{ procedures FlatToSel and SelToFlat, they will do it for you.  }

procedure DosFlatToSel;
procedure DosSelToFlat;


{ Ordinal values for OS/2 API functions }

const

{ ANSICALL }

  ord_AnsiInject                = 1;
  ord_AnsiKeyDef                = 2;
  ord_AnsiInterp                = 3;
{ BDCALLS }
  ord_NlsConvertBidiNumerics    = 1;
  ord_NlsConvertBidiString      = 2;
  ord_NlsIntSetBidiAtt          = 3;
  ord_NlsIntQueryBidiAtt        = 4;
  ord_NlsSetBidiAtt             = 5;
  ord_NlsQueryBidiAtt           = 6;
  ord_NlsInverseString          = 7;
  ord_NlsSetBidiPrint           = 8;
  ord_NlsEditShape              = 9;
  ord_NlsShapeBidiString        = 10;
  ord_NlPopup                   = 11;
{ BKSCALLS/BMSCALLS/BVSCALLS }
  ord_BksMain                   = 1;
{ PMDRAG }
  ord_DrgAccessDragInfo         = 1;
  ord_DrgAddStrHandle           = 2;
  ord_DrgAllocDragInfo          = 3;
  ord_DrgAllocDragTransfer      = 4;
  ord_DrgDeleteDragInfoStrHandles = 5;
  ord_DrgDeleteStrHandle        = 6;
  ord_DrgDrag                   = 7;
  ord_DrgFreeDragInfo           = 8;
  ord_DrgFreeDragTransfer       = 9;
  ord_DrgGetPs                  = 10;
  ord_DrgPostTransferMsg        = 11;
  ord_DrgPushDragInfo           = 12;
  ord_DrgQueryDragItem          = 13;
  ord_DrgQueryDragItemCount     = 14;
  ord_DrgQueryDragItemPtr       = 15;
  ord_DrgQueryNativeRmf         = 16;
  ord_DrgQueryNativeRmfLen      = 17;
  ord_DrgQueryStrName           = 18;
  ord_DrgQueryStrNameLen        = 19;
  ord_DrgQueryTrueType          = 20;
  ord_DrgQueryTrueTypeLen       = 21;
  ord_DrgReleasePs              = 22;
  ord_DrgSendTransferMsg        = 23;
  ord_DrgSetDragPointer         = 24;
  ord_DrgSetDragImage           = 25;
  ord_DrgSetDragItem            = 26;
  ord_DrgVerifyNativeRmf        = 27;
  ord_DrgVerifyRmf              = 28;
  ord_DrgVerifyTrueType         = 29;
  ord_DrgVerifyType             = 30;
  ord_DrgVerifyTypeSet          = 31;
  ord_Drg32AccessDragInfo       = 32;
  ord_Drg32AddStrHandle         = 33;
  ord_Drg32AllocDragInfo        = 34;
  ord_Drg32AllocDragTransfer    = 35;
  ord_Drg32DeleteDragInfoStrHandles = 36;
  ord_Drg32DeleteStrHandle      = 37;
  ord_Drg32Drag                 = 38;
  ord_Drg32FreeDragInfo         = 39;
  ord_Drg32FreeDragTransfer     = 40;
  ord_Drg32GetPs                = 41;
  ord_Drg32PostTransferMsg      = 42;
  ord_Drg32PushDragInfo         = 43;
  ord_Drg32QueryDragItem        = 44;
  ord_Drg32QueryDragItemCount   = 45;
  ord_Drg32QueryDragItemPtr     = 46;
  ord_Drg32QueryNativeRmf       = 47;
  ord_Drg32QueryNativeRmfLen    = 48;
  ord_Drg32QueryStrName         = 49;
  ord_Drg32QueryStrNameLen      = 50;
  ord_Drg32QueryTrueType        = 51;
  ord_Drg32QueryTrueTypelen     = 52;
  ord_Drg32ReleasePs            = 53;
  ord_Drg32SendTransferMsg      = 54;
  ord_Drg32SetDragPointer       = 55;
  ord_Drg32SetDragImage         = 56;
  ord_Drg32SetDragItem          = 57;
  ord_Drg32VerifyNativeRmf      = 58;
  ord_Drg32VerifyRmf            = 59;
  ord_Drg32VerifyTrueType       = 60;
  ord_Drg32VerifyType           = 61;
  ord_Drg32VerifyTypeSet        = 62;
  ord_DrgDragFiles              = 63;
  ord_DrgAcceptdroppedFiles     = 64;
  ord_Drg32DragFiles            = 65;
  ord_Drg32AcceptDroppedFiles   = 66;
{ FKA }
  ord_FkaInit                   = 64;
  ord_QueryFkaDisplayDetails    = 65;
  ord_WinFkaWndProc             = 66;
  ord_WinLoadFka                = 67;
  ord_WinCreateFKA              = 68;
  ord_WinSetFkaForm             = 69;
  ord_WinQueryFkaForm           = 70;
  ord_WinGotoFka                = 71;
  ord_WinGoFromFka              = 72;
{ HELPMGR }
  ord_WinCreateHelpInstance     = 1;
  ord_WinDestroyHelpInstance    = 2;
  ord_WinQueryHelpInstance      = 3;
  ord_WinAssociateHelpInstance  = 4;
  ord_WinLoadHelpTable          = 5;
  ord_WinCreateHelpTable        = 6;
  ord_Win32CreateHelpInstance   = 51;
  ord_Win32DestroyHelpInstance  = 52;
  ord_Win32QueryHelpInstance    = 53;
  ord_Win32AssociateHelpInstance= 54;
  ord_Win32LoadHelpTable        = 55;
  ord_Win32CreateHelpTable      = 56;
  ord_DdfInitialize             = 74;
  ord_DdfPara                   = 75;
  ord_DdfSetFormat              = 76;
  ord_DdfSetTextAlign           = 77;
  ord_DdfSetColor               = 78;
  ord_DdfInfoRm                 = 79;
  ord_DdfSetFontStyle           = 80;
  ord_DdfHyperText              = 81;
  ord_DdfBeginList              = 82;
  ord_DdfListItem               = 83;
  ord_DdfEndList                = 84;
  ord_DdfText                   = 85;
  ord_DdfMetaFile               = 86;
  ord_DdfSetFont                = 87;
  ord_DdfBitMap                 = 88;
{ KBDCALLS }
  ord_KbdSetCusTxt              = 1;
  ord_KbdGetCP                  = 3;
  ord_KbdCharIn                 = 4;
  ord_KbdSetCP                  = 5;
  ord_KbdSynch                  = 7;
  ord_KbdRegister               = 8;
  ord_KbdStringIn               = 9;
  ord_KbdGetStatus              = 10;
  ord_KbdSetStatus              = 11;
  ord_KbdGetFocus               = 12;
  ord_KbdFlushBuffer            = 13;
  ord_KbdXlate                  = 14;
  ord_KbdClose                  = 17;
  ord_KbdFreeFocus              = 18;
  ord_KbdDeRegister             = 20;
  ord_KbdSetFgnd                = 21;
  ord_KbdPeek                   = 22;
  ord_KbdOpen                   = 23;
  ord_KbdGetHwId                = 24;
  ord_KbdSetHwId                = 25;
{ MONCALLS }
  ord_DosMonWrite               = 1;
  ord_DosMonRead                = 2;
  ord_DosMonClose               = 3;
  ord_DosMonOpen                = 4;
  ord_DosMonReg                 = 5;
{ MOUCALLS }
  ord_MouGetPtrShape            = 1;
  ord_MouSetPtrShape            = 2;
  ord_MouGetNumMicKeys          = 3;
  ord_MouGetHotKey              = 4;
  ord_MouGetScaleFact           = 6;
  ord_MouFlushQue               = 7;
  ord_MouGetNumButtons          = 8;
  ord_MouClose                  = 9;
  ord_MouSetHotKey              = 10;
  ord_MouSetScaleFact           = 11;
  ord_MouGetNumQueEl            = 13;
  ord_MouDeRegister             = 14;
  ord_MouGetEventMask           = 15;
  ord_MouSetEventMask           = 16;
  ord_MouOpen                   = 17;
  ord_MouRemovePtr              = 18;
  ord_MouGetPtrPos              = 19;
  ord_MouReadEventQue           = 20;
  ord_MouSetPtrPos              = 21;
  ord_MouGetDevStatus           = 22;
  ord_MouSynch                  = 23;
  ord_MouRegister               = 24;
  ord_MouSetDevStatus           = 25;
  ord_MouDrawPtr                = 26;
  ord_MouInitReal               = 27;
  ord_MouGetThreshold           = 29;
  ord_MouSetThreshold           = 30;
{ MSG }
  ord_DosPutMessage             = 1;
  ord_DosTrueGetMessage         = 2;
  ord_DosInsMessage             = 3;
  ord_Dos32InsertMessage        = 4;
  ord_Dos32PutMessage           = 5;
  ord_Dos32TrueGetMessage       = 6;
  ord_DosIQueryMessageCP        = 7;
  ord_Dos32IQueryMessageCP      = 8;
{ NLS }
  ord_DosCaseMap                = 1;
  ord_DosGetCollate             = 2;
  ord_DosGetCtryInfo            = 3;
  ord_DosGetDbcsEv              = 4;
  ord_Dos32QueryCtryInfo        = 5;
  ord_Dos32QueryDbcsEnv         = 6;
  ord_Dos32MapCase              = 7;
  ord_Dos32QueryCollate         = 8;
{ NAMPIPES }
  ord_DosMakeNmPipe             = 1;
  ord_DosQNmPipeInfo            = 2;
  ord_DosConnectNmPipe          = 3;
  ord_DosDisConnectNmPipe       = 4;
  ord_DosQNmpHandState          = 5;
  ord_DosSetNmpHandState        = 6;
  ord_DosPeekNmPipe             = 7;
  ord_DosWaitNmPipe             = 8;
  ord_DosTransactNmPipe         = 9;
  ord_DosCallNMPipe             = 10;
  ord_DosRawReadNmPipe          = 11;
  ord_DosRawWriteNmPipe         = 12;
  ord_DosSetNmPipeSem           = 13;
  ord_DosQNmPipeSemState        = 14;
{ DOSCALLS }
  ord_DosCWait                  = 2;
  ord_DosEnterCritSec           = 3;
  ord_DosExit                   = 5;
  ord_DosExitCritSec            = 6;
  ord_DosExitList               = 7;
  ord_DosGetInfoSeg             = 8;
  ord_DosGetPrty                = 9;
  ord_DosKillProcess            = 10;
  ord_DosSetPrty                = 11;
  ord_DosPTrace                 = 12;
  ord_DosHoldSignal             = 13;
  ord_DosSetSigHandler          = 14;
  ord_DosFlagProcess            = 15;
  ord_DosMakePipe               = 16;
  ord_DosSemSetWait             = 20;
  ord_DosMuxSemWait             = 22;
  ord_DosCloseSem               = 23;
  ord_DosCreateSem              = 24;
  ord_DosOpenSem                = 25;
  ord_DosResumeThread           = 26;
  ord_DosSUSPEndThread          = 27;
  ord_DosSetDateTime            = 28;
  ord_DosTimerAsync             = 29;
  ord_DosTimerStart             = 30;
  ord_DosTimerStop              = 31;
  ord_DosSleep                  = 32;
  ord_DosGetDateTime            = 33;
  ord_DosAllocSeg               = 34;
  ord_DosAllocShrSeg            = 35;
  ord_DosGetShrSeg              = 36;
  ord_DosGiveSeg                = 37;
  ord_DosReallocSeg             = 38;
  ord_DosFreeSeg                = 39;
  ord_DosAllocHuge              = 40;
  ord_DosGetHugeShift           = 41;
  ord_DosReallocHuge            = 42;
  ord_DosCreateCSAlias          = 43;
  ord_DosLoadModule             = 44;
  ord_DosGetProcAddr            = 45;
  ord_DosFreeModule             = 46;
  ord_DosGetModHandle           = 47;
  ord_DosGetModName             = 48;
  ord_DosGetMachineMode         = 49;
  ord_DosBeep                   = 50;
  ord_DosCLIAccess              = 51;
  ord_DosDevConfig              = 52;
  ord_DosDevIOCTL               = 53;
  ord_DosBufReset               = 56;
  ord_DosChDir                  = 57;
  ord_DosChgFilePtr             = 58;
  ord_DosClose                  = 59;
  ord_DosDelete                 = 60;
  ord_DosDupHandle              = 61;
  ord_DosFileLocks              = 62;
  ord_DosFindClose              = 63;
  ord_DosFindFirst              = 64;
  ord_DosFindNext               = 65;
  ord_DosMkDir                  = 66;
  ord_DosMove                   = 67;
  ord_DosNewSize                = 68;
  ord_DosPortAccess             = 69;
  ord_DosOpen                   = 70;
  ord_DosQCurDir                = 71;
  ord_DosQCurDisk               = 72;
  ord_DosQFHandState            = 73;
  ord_DosQFileInfo              = 74;
  ord_DosQFileMode              = 75;
  ord_DosQFSInfo                = 76;
  ord_DosQHandType              = 77;
  ord_DosQVerify                = 78;
  ord_DosRmDir                  = 80;
  ord_DosSelectDisk             = 81;
  ord_DosSetFHandState          = 82;
  ord_DosSetFileInfo            = 83;
  ord_DosSetFileMode            = 84;
  ord_DosSetMaxFH               = 85;
  ord_DosSetVerify              = 86;
  ord_DosSystemService          = 88;
  ord_DosSetVec                 = 89;
  ord_DosSysTrace               = 90;
  ord_DosGetEnv                 = 91;
  ord_DosGetVersion             = 92;
  ord_DosGetPID                 = 94;
  ord_DosOpen2                  = 95;
  ord_DosLIBInit                = 96;
  ord_DosSetFSInfo              = 97;
  ord_DosQPathInfo              = 98;
  ord_DosDevIOCTL2              = 99;
  ord_DosSetPathInfo            = 104;
  ord_DosISetRelMaxFH           = 108;
  ord_DosIDevIOCTL              = 109;
  ord_Dos32ForceDelete          = 110;
  ord_Dos32KillThread           = 111;
  ord_DosQueryRasInfo           = 112;
  ord_DosError                  = 120;
  ord_DosGetSeg                 = 121;
  ord_DosLockSeg                = 122;
  ord_DosUnLockSeg              = 123;
  ord_DosSizeSeg                = 126;
  ord_DosMemAvail               = 127;
  ord_DosPhysicalDisk           = 129;
  ord_DosGetCP                  = 130;
  ord_DosSendSignal             = 134;
  ord_DosHugeShift              = 135;
  ord_DosHugeIncr               = 136;
  ord_DosRead                   = 137;
  ord_DosWrite                  = 138;
  ord_DosErrClass               = 139;
  ord_DosSemRequest             = 140;
  ord_DosSemClear               = 141;
  ord_DosSemWait                = 142;
  ord_DosSemSet                 = 143;
  ord_DosExecPgm                = 144;
  ord_DosCreateThread           = 145;
  ord_DosSubSet                 = 146;
  ord_DosSubAlloc               = 147;
  ord_DosSubFree                = 148;
  ord_DosReadASync              = 149;
  ord_DosWriteAsync             = 150;
  ord_DosSearchPath             = 151;
  ord_DosScanEnv                = 152;
  ord_DosSetCP                  = 153;
  ord_DosGetResource            = 155;
  ord_DosGetPPID                = 156;
  ord_DosCallBack               = 157;
  ord_DosR2StackRealloc         = 160;
  ord_DosFSRamSemRequest        = 161;
  ord_DosFSRamSemClear          = 162;
  ord_DosQAppType               = 163;
  ord_DosSetProcCP              = 164;
  ord_DosDynamicTrace           = 165;
  ord_DosQSysInfo               = 166;
  ord_DosFsAttach               = 181;
  ord_DosQFsAttach              = 182;
  ord_DosFsCtl                  = 183;
  ord_DosFindFirst2             = 184;
  ord_DosMkDir2                 = 185;
  ord_DosFileIO                 = 186;
  ord_DosFindNotifyClose        = 187;
  ord_DosFindNotifyFirst        = 188;
  ord_DosFindNotifyNext         = 189;
  ord_DosEditName               = 191;
  ord_DosCopy                   = 201;
  ord_DosForceDelete            = 203;
  ord_DosEnumAttribute          = 204;
  ord_DosShutDown               = 206;
  ord_DosGetResource2           = 207;
  ord_DosFreeResource           = 208;
  ord_Dos32SetMaxFh             = 209;
  ord_Dos32SetVerify            = 210;
  ord_Dos32ErrClass             = 211;
  ord_Dos32Error                = 212;
  ord_DosMaxPathLen             = 214;
  ord_DosPageSize               = 215;
  ord_DosLocalInfo              = 216;
  ord_DosGlobalInfo             = 217;
  ord_Dos32SetFileInfo          = 218;
  ord_Dos32SetPathInfo          = 219;
  ord_Dos32SetDefaultDisk       = 220;
  ord_Dos32SetFHState           = 221;
  ord_Dos32SetFSInfo            = 222;
  ord_Dos32QueryPathInfo        = 223;
  ord_Dos32QueryHType           = 224;
  ord_Dos32QueryVerify          = 225;
  ord_Dos32DeleteDir            = 226;
  ord_Dos32ScanEnv              = 227;
  ord_Dos32SearchPath           = 228;
  ord_Dos32Sleep                = 229;
  ord_Dos32GetDateTime          = 230;
  ord_Dos32DevConfig            = 231;
  ord_Dos32EnterCritSec         = 232;
  ord_Dos32ExitCritSec          = 233;
  ord_Dos32Exit                 = 234;
  ord_Dos32KillProcess          = 235;
  ord_Dos32SetPriority          = 236;
  ord_Dos32ResumeThread         = 237;
  ord_Dos32SuspendThread        = 238;
  ord_Dos32CreatePipe           = 239;
  ord_Dos32CallNPipe            = 240;
  ord_Dos32ConnectNPipe         = 241;
  ord_Dos32DisconnectNPipe      = 242;
  ord_Dos32CreateNPipe          = 243;
  ord_Dos32PeekNPipe            = 244;
  ord_Dos32QueryNpHState        = 245;
  ord_Dos32RawReadNPipe         = 246;
  ord_Dos32RawWriteNPipe        = 247;
  ord_Dos32QueryNPipeInfo       = 248;
  ord_Dos32QueryNPipeSemState   = 249;
  ord_Dos32SetNpHState          = 250;
  ord_Dos32SetNPipeSem          = 251;
  ord_Dos32TransactNPipe        = 252;
  ord_Dos32WaitNPipe            = 253;
  ord_Dos32ResetBuffer          = 254;
  ord_Dos32SetCurrentDir        = 255;
  ord_Dos32SetFilePtr           = 256;
  ord_Dos32Close                = 257;
  ord_Dos32Copy                 = 258;
  ord_Dos32Delete               = 259;
  ord_Dos32DupHandle            = 260;
  ord_Dos32EditName             = 261;
  ord_Dos32FindClose            = 263;
  ord_Dos32FindFirst            = 264;
  ord_Dos32FindNext             = 265;
  ord_DosOpenVDD                = 266;
  ord_DosRequestVDD             = 267;
  ord_DosCloseVDD               = 268;
  ord_Dos32FsAttach             = 269;
  ord_Dos32CreateDir            = 270;
  ord_Dos32Move                 = 271;
  ord_Dos32SetFileSize          = 272;
  ord_Dos32Open                 = 273;
  ord_Dos32QueryCurrentDir      = 274;
  ord_Dos32QueryCurrentDisk     = 275;
  ord_Dos32QueryFHState         = 276;
  ord_Dos32QueryFSAttach        = 277;
  ord_Dos32QueryFSInfo          = 278;
  ord_Dos32QueryFileInfo        = 279;
  ord_Dos32WaitChild            = 280;
  ord_Dos32Read                 = 281;
  ord_Dos32Write                = 282;
  ord_Dos32ExecPgm              = 283;
  ord_Dos32DevIOCTL             = 284;
  ord_Dos32FsCtl                = 285;
  ord_Dos32Beep                 = 286;
  ord_Dos32PhysicalDisk         = 287;
  ord_Dos32SetCP                = 288;
  ord_Dos32SetProcessCP         = 289;
  ord_Dos32StopTimer            = 290;
  ord_Dos32QueryCP              = 291;
  ord_Dos32SetDateTime          = 292;
  ord_Dos32ExitList             = 296;
  ord_Dos32AllocMem             = 299;
  ord_Dos32AllocSharedMem       = 300;
  ord_Dos32GetNamedSharedMem    = 301;
  ord_Dos32GetSharedMem         = 302;
  ord_Dos32GiveSharedMem        = 303;
  ord_Dos32FreeMem              = 304;
  ord_Dos32SetMem               = 305;
  ord_Dos32QueryMem             = 306;
  ord_Dos32OpenVDD              = 308;
  ord_Dos32RequestVDD           = 309;
  ord_Dos32CloseVDD             = 310;
  ord_Dos32CreateThread         = 311;
  ord_Dos32GetInfoBlocks        = 312;
  ord_Dos32DynamicTrace         = 316;
  ord_Dos32Debug                = 317;
  ord_Dos32LoadModule           = 318;
  ord_Dos32QueryModuleHandle    = 319;
  ord_Dos32QueryModuleName      = 320;
  ord_Dos32QueryProcAddr        = 321;
  ord_Dos32FreeModule           = 322;
  ord_Dos32QueryAppType         = 323;
  ord_Dos32CreateEventSem       = 324;
  ord_Dos32OpenEventSem         = 325;
  ord_Dos32CloseEventSem        = 326;
  ord_Dos32ResetEventSem        = 327;
  ord_Dos32PostEventSem         = 328;
  ord_Dos32WaitEventSem         = 329;
  ord_Dos32QueryEventSem        = 330;
  ord_Dos32CreateMutexSem       = 331;
  ord_Dos32OpenMutexSem         = 332;
  ord_Dos32CloseMutexSem        = 333;
  ord_Dos32RequestMutexSem      = 334;
  ord_Dos32ReleaSeMutexSem      = 335;
  ord_Dos32QueryMutexSem        = 336;
  ord_Dos32CreateMuxWaitSem     = 337;
  ord_Dos32OpenMuxWaitSem       = 338;
  ord_Dos32CloseMuxWaitSem      = 339;
  ord_Dos32WaitMuxWaitSem       = 340;
  ord_Dos32AddMuxWaitSem        = 341;
  ord_Dos32DeleteMuxWaitSem     = 342;
  ord_Dos32QueryMuxWaitSem      = 343;
  ord_Dos32SubSetMem            = 344;
  ord_Dos32SubAllocMem          = 345;
  ord_Dos32SubFreeMem           = 346;
  ord_Dos32SubUnsetMem          = 347;
  ord_Dos32QuerySysInfo         = 348;
  ord_Dos32WaitThread           = 349;
  ord_Dos32AsyncTimer           = 350;
  ord_Dos32StartTimer           = 351;
  ord_Dos32GetResource          = 352;
  ord_Dos32FreeResource         = 353;
  ord_Dos32SetExceptionHandler  = 354;
  ord_Dos32UnsetExceptionHandler= 355;
  ord_Dos32RaiseException       = 356;
  ord_Dos32UnwindException      = 357;
  ord_Dos32TmrQueryFreq         = 362;
  ord_Dos32TmrQueryTime         = 363;
  ord_Dos32RegisterPerfctRs     = 367;
  ord_Dos32EnumAttribute        = 372;
  ord_Dos32QueryDosProperty     = 373;
  ord_Dos32SetDosProperty       = 374;
  ord_DosQueryDosProperty       = 375;
  ord_DosSetDosProperty         = 376;
  ord_Dos32ProFile              = 377;
  ord_Dos32SetSignalExceptionFocus = 378;
  ord_Dos32SendSignalException  = 379;
  ord_Dos32EnterMustComplete    = 380;
  ord_Dos32ExitMustComplete     = 381;
  ord_Dos32SetRelMaxFh          = 382;
  ord_Dos32ShutDown             = 415;
  ord_Dos32ReplaceModule        = 417;
  ord_Dos32AcknowledgeSignalException = 418;
  ord_Dos32TIB                  = 419;
  ord_DosTmrQueryFreq           = 420;
  ord_DosTmrQueryTime           = 421;
  ord_DosRegisterPerfctRs       = 422;
  ord_DosFlatToSel              = 423;
  ord_DosSelToFlat              = 424;
  ord_Dos32FlatToSel            = 425;
  ord_Dos32SelToFlat            = 426;
  ord_Dos32SetFileLocks         = 428;
  ord_Dos32CancelLockRequest    = 429;
  ord_DosOpenChangeNotify       = 437;
  ord_DosRESetChangeNotify      = 438;
  ord_DosCloseChangeNotify      = 439;
  ord_Dos32OpenChangeNotify     = 440;
  ord_Dos32RESetChangeNotify    = 441;
  ord_Dos32CloseChangeNotify    = 442;
  ord_Dos32AllocThreadLocalMemory= 454;
  ord_Dos32FreeThreadLocalMemory = 455;
  ord_Dos32QueryResourceSize    = 572;
  ord_DosQueryResourceSize      = 573;
  ord_Dos32InitializePortHole   = 580;
  ord_Dos32QueryHeaderInfo      = 582;
  ord_DosInitializePortHole     = 583;
  ord_DosQueryHeaderInfo        = 584;
  ord_Dos32QueryProcType        = 586;
  ord_DosQueryProcType          = 587;
  ord_Dos32SetExtLibpath        = 873;
  ord_Dos32QueryExtLibpath      = 874;
  ord_DosSetExtLibpath          = 998;
  ord_DosQueryExtLibpath        = 999;
{ PMGPI }
  ord_DevOpendC                 = 1;
  ord_DevCloseDC                = 2;
  ord_DevPostDeviceModes        = 3;
  ord_DevESCAPE                 = 4;
  ord_DevQueryHardCopyCaps      = 5;
  ord_DevQueryCaps              = 6;
  ord_GpiCreatePS               = 7;
  ord_GpiQueryPS                = 9;
  ord_GpiDestroyPS              = 10;
  ord_GpiResetPS                = 11;
  ord_GpiSavePS                 = 12;
  ord_GpiRestorePS              = 13;
  ord_GpiAssociate              = 14;
  ord_GpiErrorSegmentData       = 15;
  ord_GpiErase                  = 16;
  ord_GpiSetDrawControl         = 17;
  ord_GpiQueryDrawControl       = 18;
  ord_GpiDrawChain              = 19;
  ord_GpiDrawFROM               = 20;
  ord_GpiDrawSegment            = 21;
  ord_GpiSetStopDraw            = 22;
  ord_GpiQueryStopDraw          = 23;
  ord_GpiRemoveDynamics         = 24;
  ord_GpiDrawDynamics           = 25;
  ord_GpiSetDrawinGMode         = 26;
  ord_GpiQueryDrawinGMode       = 27;
  ord_GpiGetData                = 28;
  ord_GpiPutData                = 29;
  ord_GpiSetPickApertureSize    = 30;
  ord_GpiQueryPickApertureSize  = 31;
  ord_GpiSetPickAperturePosition= 32;
  ord_GpiQueryPickAperturePosition=33;
  ord_GpiSetTag                 = 34;
  ord_GpiQueryTag               = 35;
  ord_GpiCorrelateChain         = 36;
  ord_GpiCorrelateFrom          = 37;
  ord_GpiCorrelateSegment       = 38;
  ord_GpiResetBoundaryData      = 42;
  ord_GpiQueryBoundaryData      = 43;
  ord_GpiOpenSegment            = 44;
  ord_GpiCloseSegment           = 46;
  ord_GpiDeleteSegment          = 47;
  ord_GpiDeleteSegments         = 48;
  ord_GpiQuerySegmentNames      = 49;
  ord_GpiSetInitialSegmentAttrs = 51;
  ord_GpiQueryInitialSegmentAttrs=52;
  ord_GpiSetSegmentAttrs        = 53;
  ord_GpiQuerySegmentAttrs      = 54;
  ord_GpiSetSegmentPriority     = 55;
  ord_GpiQuerySegmentPriority   = 56;
  ord_GpiSetEditMode            = 57;
  ord_GpiQueryEditMode          = 58;
  ord_GpiSetElementPointer      = 59;
  ord_GpiQueryElementPointer    = 60;
  ord_GpiOffsetElementPointer   = 61;
  ord_GpiDeleteElement          = 62;
  ord_GpiDeleteElementRange     = 63;
  ord_GpiLabel                  = 64;
  ord_GpiSetElementPointerAtLabel=65;
  ord_GpiDeleteElementsBetweenLabels=66;
  ord_GpiQueryElementType       = 67;
  ord_GpiQueryElement           = 68;
  ord_GpiElement                = 69;
  ord_GpiBeginElement           = 70;
  ord_GpiEndElement             = 71;
  ord_GpiSetSegmentTransformMatrix= 78;
  ord_GpiQuerySegmentTransformMatrix=79;
  ord_GpiSetModelTransformMatrix= 80;
  ord_GpiQueryModelTransformMatrix=81;
  ord_GpiCallSegmentMatrix      = 82;
  ord_GpiSetDefaultViewMatrix   = 83;
  ord_GpiQueryDefaultViewMatrix = 84;
  ord_GpiSetPageViewPort        = 85;
  ord_GpiQueryPageViewPort      = 86;
  ord_GpiSetViewinGTransformMatrix=87;
  ord_GpiQueryViewinGTransformMatrix=88;
  ord_GpiSetGraphicsField       = 89;
  ord_GpiQueryGraphicsField     = 90;
  ord_GpiSetViewInGLimits       = 91;
  ord_GpiQueryViewInGLimits     = 92;
  ord_GpiConvert                = 93;
  ord_GpiSetAttrMode            = 94;
  ord_GpiQueryAttrMode          = 95;
  ord_GpiPop                    = 96;
  ord_GpiSetAttrs               = 97;
  ord_GpiQueryAttrs             = 98;
  ord_GpiCreateLogColorTable    = 99;
  ord_GpiRealizeColorTable      = 100;
  ord_GpiUnrealizeColorTable    = 101;
  ord_GpiQueryColorData         = 102;
  ord_GpiQueryLogColorTable     = 103;
  ord_GpiQueryRealColors        = 104;
  ord_GpiQueryNearestColor      = 105;
  ord_GpiQueryColorIndex        = 106;
  ord_GpiQueryRGBColor          = 107;
  ord_GpiSetColor               = 108;
  ord_GpiQueryColor             = 109;
  ord_GpiSetBackColor           = 110;
  ord_GpiQueryBackColor         = 111;
  ord_GpiSetMix                 = 112;
  ord_GpiQueryMix               = 113;
  ord_GpiSetBackMix             = 114;
  ord_GpiQueryBackMix           = 115;
  ord_GpiSetLineType            = 116;
  ord_GpiQueryLineType          = 117;
  ord_GpiSetLineWidth           = 118;
  ord_GpiQueryLineWidth         = 119;
  ord_GpiSetLineWidthGeom       = 120;
  ord_GpiQueryLineWidthGeom     = 121;
  ord_GpiSetLineEnd             = 122;
  ord_GpiQueryLineEnd           = 123;
  ord_GpiSetLineJoin            = 124;
  ord_GpiQueryLineJoin          = 125;
  ord_GpiSetCurrentPosition     = 126;
  ord_GpiQueryCurrentPosition   = 127;
  ord_GpiMove                   = 128;
  ord_GpiLine                   = 129;
  ord_GpiPolyLine               = 130;
  ord_GpiBox                    = 131;
  ord_GpiPtVisible              = 132;
  ord_GpiRectVisible            = 133;
  ord_GpiSetArcParams           = 134;
  ord_GpiQueryArcParams         = 135;
  ord_GpiPointArc               = 136;
  ord_GpiFullArc                = 137;
  ord_GpiPartialArc             = 138;
  ord_GpiPolyFillet             = 139;
  ord_GpiPolyFilletSharp        = 140;
  ord_GpiPolySPLine             = 141;
  ord_GpiSetBitMapId            = 142;
  ord_GpiQueryBitMapHandle      = 143;
  ord_GpiSetPatternSet          = 144;
  ord_GpiQueryPatternSet        = 145;
  ord_GpiSetPattern             = 146;
  ord_GpiQueryPattern           = 147;
  ord_GpiSetPatternREFPoint     = 148;
  ord_GpiQueryPatternREFPoint   = 149;
  ord_GpiBeginArea              = 150;
  ord_GpiEndArea                = 151;
  ord_GpiLoadFonts              = 152;
  ord_GpiUnloadFonts            = 153;
  ord_GpiCreateLogFont          = 154;
  ord_GpiDeleteSetId            = 155;
  ord_GpiQueryNumberSetIDS      = 156;
  ord_GpiQuerySetIds            = 157;
  ord_GpiQueryFonts             = 158;
  ord_GpiQueryFontMetrics       = 159;
  ord_GpiQueryKerningPairs      = 160;
  ord_GpiQueryWidthTable        = 161;
  ord_GpiSetCP                  = 162;
  ord_GpiQueryCP                = 163;
  ord_GpiQueryTextBox           = 164;
  ord_DevQueryDeviceNames       = 165;
  ord_GpiQueryDefCharBox        = 166;
  ord_GpiQueryFontFileDescriptions=167;
  ord_GpiSetCharSet             = 168;
  ord_GpiQueryCharSet           = 169;
  ord_GpiSetCharBox             = 170;
  ord_GpiQueryCharBox           = 171;
  ord_GpiSetCharAngle           = 172;
  ord_GpiQueryCharAngle         = 173;
  ord_GpiSetCharShear           = 174;
  ord_GpiQueryCharShear         = 175;
  ord_GpiSetCharDirection       = 176;
  ord_GpiQueryCharDirection     = 177;
  ord_GpiSetCharMode            = 178;
  ord_GpiQueryCharMode          = 179;
  ord_GpiCharString             = 180;
  ord_GpiCharStringAt           = 181;
  ord_GpiCharStringPos          = 182;
  ord_GpiCharStringPosAt        = 183;
  ord_GpiSetMarkerSet           = 184;
  ord_GpiQueryMarkerSet         = 185;
  ord_GpiSetMarker              = 186;
  ord_GpiQueryMarker            = 187;
  ord_GpiSetMarkerBox           = 188;
  ord_GpiQueryMarkerBox         = 189;
  ord_GpiMarker                 = 190;
  ord_GpiPolyMarker             = 191;
  ord_GpiImage                  = 192;
  ord_GpiCreateBitMap           = 196;
  ord_GpiDeleteBitMap           = 197;
  ord_GpiSetBitMap              = 198;
  ord_GpiSetBitMapDimension     = 199;
  ord_GpiQueryBitMapDimension   = 200;
  ord_GpiQueryDeviceBitMapFormats=201;
  ord_GpiQueryBitMapParameters  = 202;
  ord_GpiSetBitMapBits          = 203;
  ord_GpiQueryBitMapBits        = 204;
  ord_GpiBitBlt                 = 205;
  ord_GpiSetPel                 = 206;
  ord_GpiQueryPel               = 207;
  ord_GpiCreateRegion           = 208;
  ord_GpiSetRegion              = 209;
  ord_GpiDestroyRegion          = 210;
  ord_GpiCombineRegion          = 211;
  ord_GpiEqualRegion            = 212;
  ord_GpiOffsetRegion           = 213;
  ord_GpiPtInRegion             = 214;
  ord_GpiRectInRegion           = 215;
  ord_GpiQueryRegionBox         = 216;
  ord_GpiQueryRegionRects       = 217;
  ord_GpiSetClipRegion          = 218;
  ord_GpiQueryClipRegion        = 219;
  ord_GpiQueryClipBox           = 220;
  ord_GpiIntersectClipRectangle = 221;
  ord_GpiExcludeClipRectangle   = 222;
  ord_GpiOffsetClipRegion       = 223;
  ord_GpiPaintRegion            = 224;
  ord_GpiLoadMetaFile           = 225;
  ord_GpiCopyMetafile           = 226;
  ord_GpiPlayMetafile           = 227;
  ord_GpiSaveMetaFile           = 228;
  ord_GpiDeleteMetaFile         = 229;
  ord_GpiQueryMetaFileBits      = 230;
  ord_GpiSetMetaFileBits        = 231;
  ord_GpiQueryMetaFileLength    = 232;
  ord_GpiSetClipPath            = 233;
  ord_GpiBeginPath              = 234;
  ord_GpiEndPath                = 235;
  ord_GpiCloseFigure            = 236;
  ord_GpiModifyPath             = 237;
  ord_GpiFillPath               = 238;
  ord_GpiStartRequest           = 239;
  ord_GpiQueryDevice            = 240;
  ord_DevStdOpen                = 244;
  ord_GpiQueryCharStringPos     = 245;
  ord_GpiQueryCharStringPosAt   = 246;
  ord_GpiSetPS                  = 248;
  ord_SegSGWOpenSegmentWindow   = 249;
  ord_MtEndReadRequest          = 250;
  ord_MtGetDESCRIPTION          = 251;
  ord_FmtOrderTable             = 252;
  ord_MtGetCodePage             = 253;
  ord_MtGetLct                  = 254;
  ord_MtGetGDDInfo              = 255;
  ord_FttConvertGocaPoly        = 256;
  ord_MtGetFirstFont            = 257;
  ord_SegSGWNewPartData         = 258;
  ord_MtStartReadRequest        = 259;
  ord_MtGetFirstGraphicsData    = 260;
  ord_MtGetNextFont             = 261;
  ord_MtGetNextGraphicsData     = 262;
  ord_GpiLoadPublicFonts        = 263;
  ord_GpiUnloadPublicFonts      = 264;
  ord_GpiComment                = 268;
  ord_GpiWcBitBlt               = 269;
  ord_GpiStrOKEPath             = 270;
  ord_SegSGWNextOrderF          = 271;
  ord_GpiOutlinePath            = 274;
  ord_GpiSetDefTag              = 275;
  ord_GpiQueryDefTag            = 276;
  ord_GpiSetDefAttrs            = 277;
  ord_GpiQueryDefAttrs          = 278;
  ord_GpiSetDefViewingLimits    = 279;
  ord_GpiQueryDefViewingLimits  = 280;
  ord_GpiSetDefArcParams        = 281;
  ord_GpiQueryDefArcParams      = 282;
  ord_GpiTranslate              = 283;
  ord_GpiScale                  = 284;
  ord_GpiRotate                 = 285;
  ord_GpiPolyLineDisjoint       = 286;
  ord_GpiPathToRegion           = 287;
  ord_GpiFloodFill              = 289;
  ord_GpiDrawBits               = 290;
  ord_GpiQueryBitMapInfoHeader  = 291;
  ord_GpiQueryLogicalFont       = 292;
  ord_GpiQueryFaceString        = 293;
  ord_GpiQueryFontAction        = 294;
  ord_GpiCreatePalette          = 295;
  ord_GpiDeletePalette          = 296;
  ord_GpiSelectPalette          = 297;
  ord_GpiAnimatePalette         = 298;
  ord_GpiSetPaletteEntries      = 299;
  ord_GpiQueryPalette           = 300;
  ord_GpiQueryPaletteInfo       = 301;
  ord_GpiQueryCharExtra         = 302;
  ord_GpiSetCharExtra           = 303;
  ord_GpiQueryCharBreakExtra    = 304;
  ord_GpiSetCharBreakExtra      = 305;
  ord_GpiFrameRegion            = 306;
  ord_GpiConvertWithMatrix      = 307;
  ord_Gpi32Associate            = 351;
  ord_Gpi32BeginArea            = 352;
  ord_Gpi32BeginElement         = 353;
  ord_Gpi32BeginPath            = 354;
  ord_Gpi32Bitblt               = 355;
  ord_Gpi32Box                  = 356;
  ord_Gpi32CallSegmentMatrix    = 357;
  ord_Gpi32CharString           = 358;
  ord_Gpi32CharStringAt         = 359;
  ord_Gpi32CloseFigure          = 360;
  ord_Gpi32CloseSegment         = 361;
  ord_Gpi32CombineRegion        = 362;
  ord_Gpi32Comment              = 363;
  ord_Gpi32Convert              = 364;
  ord_Gpi32CopyMetaFile         = 365;
  ord_Gpi32CorrelateChain       = 366;
  ord_Gpi32CorrelateFrom        = 367;
  ord_Gpi32CreateLogFont        = 368;
  ord_Gpi32CreatePS             = 369;
  ord_Gpi32CreateRegion         = 370;
  ord_Gpi32DeleteBitMap         = 371;
  ord_Gpi32DeleteElement        = 372;
  ord_Gpi32DeleteElementRange   = 373;
  ord_Gpi32DeleteElementsBetweenLabe=374;
  ord_Gpi32DeleteMetaFile       = 375;
  ord_Gpi32DeleteSegment        = 376;
  ord_Gpi32DeleteSegments       = 377;
  ord_Gpi32DeleteSetId          = 378;
  ord_Gpi32DestroyPS            = 379;
  ord_Gpi32DrawChain            = 380;
  ord_Gpi32DrawDynamics         = 381;
  ord_Gpi32DrawFrom             = 382;
  ord_Gpi32DrawSegment          = 383;
  ord_Gpi32Element              = 384;
  ord_Gpi32EndArea              = 385;
  ord_Gpi32EndElement           = 386;
  ord_Gpi32EndPath              = 387;
  ord_Gpi32EqualRegion          = 388;
  ord_Gpi32Erase                = 389;
  ord_Gpi32ErrorSegmentData     = 390;
  ord_Gpi32ExcludeClipRectangle = 391;
  ord_Gpi32FillPath             = 392;
  ord_Gpi32FullArc              = 393;
  ord_Gpi32GetData              = 394;
  ord_Gpi32Image                = 395;
  ord_Gpi32IntersectClipRectangle=396;
  ord_Gpi32Label                = 397;
  ord_Gpi32Line                 = 398;
  ord_Gpi32LoadBitMap           = 399;
  ord_Gpi32LoadFonts            = 400;
  ord_Gpi32LoadMetaFile         = 401;
  ord_Gpi32Marker               = 402;
  ord_Gpi32ModifyPath           = 403;
  ord_Gpi32Move                 = 404;
  ord_Gpi32OffsetClipRegion     = 405;
  ord_Gpi32OffsetElementPointer = 406;
  ord_Gpi32OffsetRegion         = 407;
  ord_Gpi32OpenSegment          = 408;
  ord_Gpi32PaintRegion          = 409;
  ord_Gpi32PlayMetaFile         = 411;
  ord_Gpi32PointArc             = 412;
  ord_Gpi32PolyFillet           = 413;
  ord_Gpi32PolyFilletSharp      = 414;
  ord_Gpi32PolyLine             = 415;
  ord_Gpi32PolyMarker           = 416;
  ord_Gpi32PolySPLine           = 417;
  ord_Gpi32Pop                  = 418;
  ord_Gpi32PtInRegion           = 419;
  ord_Gpi32PtVisible            = 420;
  ord_Gpi32PutData              = 421;
  ord_Gpi32QueryArcParams       = 422;
  ord_Gpi32QueryAttrMode        = 423;
  ord_Gpi32QueryBackColor       = 424;
  ord_Gpi32QueryBackMix         = 425;
  ord_Gpi32QueryBitMapDimension = 426;
  ord_Gpi32QueryBitMapHandle    = 427;
  ord_Gpi32QueryBoundaryData    = 428;
  ord_Gpi32QueryCharAngle       = 429;
  ord_Gpi32QueryCharBox         = 430;
  ord_Gpi32QueryCharDirection   = 431;
  ord_Gpi32QueryCharMode        = 432;
  ord_Gpi32QueryCharSet         = 433;
  ord_Gpi32QueryCharShear       = 434;
  ord_Gpi32QueryClipBox         = 435;
  ord_Gpi32QueryClipRegion      = 436;
  ord_Gpi32QueryColor           = 437;
  ord_Gpi32QueryColorData       = 438;
  ord_Gpi32QueryColorIndex      = 439;
  ord_Gpi32QueryCP              = 440;
  ord_Gpi32QueryCurrentPosition = 441;
  ord_Gpi32QueryDefCharBox      = 442;
  ord_Gpi32QueryDefaultViewMatrix=443;
  ord_Gpi32QueryDevice          = 444;
  ord_Gpi32QueryDeviceBitMapFormats=445;
  ord_Gpi32QueryDrawControl     = 446;
  ord_Gpi32QueryDrawInGMode     = 447;
  ord_Gpi32QueryEditMode        = 448;
  ord_Gpi32QueryElement         = 449;
  ord_Gpi32QueryElementPointer  = 450;
  ord_Gpi32QueryElementType     = 451;
  ord_Gpi32QueryFontFileDescriptions=452;
  ord_Gpi32QueryFontMetrics     = 453;
  ord_Gpi32QueryGraphicsField   = 454;
  ord_Gpi32QueryInitialSegmentAttrs=455;
  ord_Gpi32QueryKerningPairs    = 456;
  ord_Gpi32QueryLineEnd         = 457;
  ord_Gpi32QueryLineJoin        = 458;
  ord_Gpi32QueryLineType        = 459;
  ord_Gpi32QueryLineWidth       = 460;
  ord_Gpi32QueryLineWidthGeom   = 461;
  ord_Gpi32QueryMarker          = 462;
  ord_Gpi32QueryMarkerBox       = 463;
  ord_Gpi32QueryMarkerSet       = 464;
  ord_Gpi32QueryMetaFileBits    = 465;
  ord_Gpi32QueryMetaFileLength  = 466;
  ord_Gpi32QueryMix             = 467;
  ord_Gpi32QueryModeLTransformMatrix=468;
  ord_Gpi32QueryNearestColor    = 469;
  ord_Gpi32QueryNumberSetIds    = 470;
  ord_Gpi32QueryPS              = 471;
  ord_Gpi32QueryPageViewPort    = 472;
  ord_Gpi32QueryPattern         = 473;
  ord_Gpi32QueryPatternRefPoint = 474;
  ord_Gpi32QueryPatternSet      = 475;
  ord_Gpi32QueryPel             = 476;
  ord_Gpi32QueryPickAperturePosition=477;
  ord_Gpi32QueryPickApertureSize= 478;
  ord_Gpi32QueryRGBColor        = 479;
  ord_Gpi32QueryRealColors      = 480;
  ord_Gpi32QueryRegionBox       = 481;
  ord_Gpi32QuerySegmentAttrs    = 482;
  ord_Gpi32QuerySegmentNames    = 483;
  ord_Gpi32QuerySegmentPriority = 484;
  ord_Gpi32QuerySegmentTransformMatr=485;
  ord_Gpi32QuerySetIds          = 486;
  ord_Gpi32QueryStopDraw        = 487;
  ord_Gpi32QueryTag             = 488;
  ord_Gpi32QueryTextBox         = 489;
  ord_Gpi32QueryViewinGLimits   = 490;
  ord_Gpi32QueryViewinGTransformMatr=491;
  ord_Gpi32QueryWidthTable      = 492;
  ord_Gpi32RectInRegion         = 494;
  ord_Gpi32RectVisible          = 495;
  ord_Gpi32RemoveDynamics       = 496;
  ord_Gpi32ResetBoundaryData    = 497;
  ord_Gpi32ResetPS              = 498;
  ord_Gpi32RestorePS            = 499;
  ord_Gpi32SaveMetaFile         = 500;
  ord_Gpi32SavePS               = 501;
  ord_Gpi32SetArcParams         = 502;
  ord_Gpi32SetAttrMode          = 503;
  ord_Gpi32SetBackColor         = 504;
  ord_Gpi32SetBackMix           = 505;
  ord_Gpi32SetBitMap            = 506;
  ord_Gpi32SetBitMapDimension   = 507;
  ord_Gpi32SetBitMapId          = 508;
  ord_Gpi32SetCharAngle         = 509;
  ord_Gpi32SetCharBox           = 510;
  ord_Gpi32SetCharDirection     = 511;
  ord_Gpi32SetCharMode          = 512;
  ord_Gpi32SetCharSet           = 513;
  ord_Gpi32SetCharShear         = 514;
  ord_Gpi32SetClipPath          = 515;
  ord_Gpi32SetClipRegion        = 516;
  ord_Gpi32SetColor             = 517;
  ord_Gpi32SetCP                = 518;
  ord_Gpi32SetCurrentPosition   = 519;
  ord_Gpi32SetDefaultViewMatrix = 520;
  ord_Gpi32SetDrawControl       = 521;
  ord_Gpi32SetDrawinGMode       = 522;
  ord_Gpi32SetEditMode          = 523;
  ord_Gpi32SetElementPointer    = 524;
  ord_Gpi32SetElementPointerAtLabel=525;
  ord_Gpi32SetGraphicsField     = 526;
  ord_Gpi32SetInitialSegmentAttrs=527;
  ord_Gpi32SetLineEnd           = 528;
  ord_Gpi32SetLineJoin          = 529;
  ord_Gpi32SetLineType          = 530;
  ord_Gpi32SetLineWidth         = 531;
  ord_Gpi32SetLineWidthGeom     = 532;
  ord_Gpi32SetMarker            = 533;
  ord_Gpi32SetMarkerBox         = 534;
  ord_Gpi32SetMarkerSet         = 535;
  ord_Gpi32SetMetaFileBits      = 536;
  ord_Gpi32SetMix               = 537;
  ord_Gpi32SetModeLTransformMatrix=538;
  ord_Gpi32SetPS                = 539;
  ord_Gpi32SetPageViewPort      = 540;
  ord_Gpi32SetPattern           = 541;
  ord_Gpi32SetPatternRefPoint   = 542;
  ord_Gpi32SetPatternSet        = 543;
  ord_Gpi32SetPel               = 544;
  ord_Gpi32SetPickAperturePosition=545;
  ord_Gpi32SetRegion            = 546;
  ord_Gpi32SetSegmentAttrs      = 547;
  ord_Gpi32SetSegmentPriority   = 548;
  ord_Gpi32SetSegmentTransformMatrix=549;
  ord_Gpi32SetStopDraw          = 550;
  ord_Gpi32SetTag               = 551;
  ord_Gpi32SetViewinGLimits     = 552;
  ord_Gpi32SetViewinGTransformMatrix=553;
  ord_Gpi32StrOKEPath           = 554;
  ord_Gpi32UnloadFonts          = 555;
  ord_Gpi32WcBitBlt             = 557;
  ord_Gpi32PolyLineDisjoint     = 558;
  ord_Gpi32PathToRegion         = 559;
  ord_Gpi32FloodFill            = 560;
  ord_Gpi32SuspendPlay          = 561;
  ord_Gpi32ResumePlay           = 562;
  ord_Gpi32OutLinePath          = 563;
  ord_Gpi32Translate            = 564;
  ord_Gpi32Scale                = 565;
  ord_Gpi32Rotate               = 566;
  ord_Gpi32QueryDefarcParams    = 567;
  ord_Gpi32QueryDefTag          = 568;
  ord_Gpi32QueryDefViewingLimits= 569;
  ord_Gpi32SetDefArcParams      = 570;
  ord_Gpi32SetDefTag            = 571;
  ord_Gpi32SetDefViewingLimits  = 572;
  ord_Gpi32QueryBitMapParameters= 573;
  ord_Gpi32QueryLogicalFont     = 574;
  ord_Gpi32QueryFaceString      = 575;
  ord_Gpi32QueryFontAction      = 576;
  ord_Gpi32DeletePalette        = 577;
  ord_Gpi32SelectPalette        = 578;
  ord_Gpi32QueryPalette         = 579;
  ord_Gpi32CharStringPos        = 580;
  ord_Gpi32CharStringPosAt      = 581;
  ord_Gpi32CorrelateSegment     = 582;
  ord_Gpi32QueryAttrs           = 583;
  ord_Gpi32QueryCharStringPos   = 584;
  ord_Gpi32QueryCharStringPosAt = 585;
  ord_Gpi32QueryFonts           = 586;
  ord_Gpi32QueryRegionRects     = 587;
  ord_Gpi32SetAttrs             = 588;
  ord_Gpi32SetPickApertureSize  = 589;
  ord_Gpi32QueryDefAttrs        = 590;
  ord_Gpi32SetDefAttrs          = 591;
  ord_Gpi32CreateLogColorTable  = 592;
  ord_Gpi32QueryLogColorTable   = 593;
  ord_Gpi32CreatePalette        = 594;
  ord_Gpi32AnimatePalette       = 595;
  ord_Gpi32SetPaletteEntries    = 596;
  ord_Gpi32QueryPaletteInfo     = 597;
  ord_Gpi32CreateBitMap         = 598;
  ord_Gpi32QueryBitMapBits      = 599;
  ord_Gpi32QueryBitMapInfoHeader= 601;
  ord_Gpi32SetBitMapBits        = 602;
  ord_Gpi32DrawBits             = 603;
  ord_Dev32CloseDC              = 604;
  ord_Dev32Escape               = 605;
  ord_Dev32QueryCaps            = 606;
  ord_Dev32QueryDeviceNames     = 607;
  ord_Dev32QueryHardCopyCaps    = 608;
  ord_Dev32PostDeviceModes      = 609;
  ord_Dev32OpendC               = 610;
  ord_Gpi32DestroyRegion        = 611;
  ord_Gpi32PartialArc           = 612;
  ord_Gpi32QueryCharExtra       = 613;
  ord_Gpi32SetCharExtra         = 614;
  ord_Gpi32QueryCharBreakExtra  = 615;
  ord_Gpi32SetCharBreakextra    = 616;
  ord_Gpi32FrameRegion          = 617;
  ord_Gpi32ConvertWithMatrix    = 618;
  ord_Gpi32LoadPublicFonts      = 622;
  ord_Gpi32UnloadPublicFonts    = 623;
  ord_Gpi32QueryTextAlignment   = 648;
  ord_Gpi32SetTextAlignment     = 649;
  ord_Gpi32Polygons             = 650;
  ord_Gpi32QueryFullFontFileDescs = 657;
{ PMWIN }
  ord_WinQueryDesktopWindow     = 1;
  ord_WinQueryObjectWindow      = 2;
  ord_WinRegisterClass          = 3;
  ord_WinQueryClassName         = 4;
  ord_WinQueryClassInfo         = 5;
  ord_WinCreateWindow           = 6;
  ord_WinDestroyWindow          = 7;
  ord_WinSetWindowPos           = 8;
  ord_WinSetMultWindowPos       = 9;
  ord_WinQueryWindowPos         = 10;
  ord_WinEnableWindow           = 11;
  ord_WinIsWindowEnabled        = 12;
  ord_WinShowWindow             = 13;
  ord_WinEnableWindowUpdate     = 14;
  ord_WinIsWindowVisible        = 15;
  ord_WinSetWindowText          = 16;
  ord_WinQueryWindowText        = 17;
  ord_WinQueryWindowTextLength  = 18;
  ord_WinWindowFromId           = 19;
  ord_WinMultWindowFromIds      = 20;
  ord_WinIsWindow               = 21;
  ord_WinIsChild                = 22;
  ord_WinSetParent              = 23;
  ord_WinSetOwner               = 24;
  ord_WinQueryWindow            = 25;
  ord_WinQueryWindowRect        = 26;
  ord_WinQueryWindowProcess     = 27;
  ord_WinSetWindowUShort        = 28;
  ord_WinQueryWindowUShort      = 29;
  ord_WinSetWindowULong         = 30;
  ord_WinQueryWindowULong       = 31;
  ord_WinBeginEnumWindows       = 32;
  ord_WinGetNextWindow          = 33;
  ord_WinEndEnumWindows         = 34;
  ord_WinWindowFromPoint        = 35;
  ord_WinMapWindowPoints        = 36;
  ord_WinSubClassWindow         = 37;
  ord_WinLockWindow             = 38;
  ord_WinQueryWindowLockCount   = 39;
  ord_WinRegisterWindowDestroy  = 40;
  ord_WinOpenWindowDC           = 41;
  ord_WinGetScreenPS            = 42;
  ord_WinGetPS                  = 43;
  ord_WinReleasePS              = 44;
  ord_WinBeginPaint             = 45;
  ord_WinEndPaint               = 46;
  ord_WinInvalidateRect         = 47;
  ord_WinInvalidateRegion       = 48;
  ord_WinValidateRect           = 49;
  ord_WinValidateRegion         = 50;
  ord_WinQueryUpdateRect        = 51;
  ord_WinQueryUpdateRegion      = 52;
  ord_WinUpdateWindow           = 53;
  ord_WinExcludeUpdateRegion    = 54;
  ord_WinLockWindowUpdate       = 55;
  ord_WinLockVisRegions         = 56;
  ord_WinWindowFromDC           = 57;
  ord_WinCreateMsgQueue         = 58;
  ord_WinDestroyMsgQueue        = 59;
  ord_WinQueryQueueStatus       = 60;
  ord_WinSendMsg                = 61;
  ord_WinBroadCastMsg           = 63;
  ord_WinInsendMsg              = 64;
  ord_WinGetMsg                 = 65;
  ord_WinPeekMsg                = 66;
  ord_WinWaitMsg                = 67;
  ord_WinDispatchMsg            = 68;
  ord_WinPostMsg                = 69;
  ord_WinPostQueueMsg           = 70;
  ord_WinQueryMsgPos            = 71;
  ord_WinQueryMsgTime           = 72;
  ord_WinCallMsgFilter          = 73;
  ord_WinSetMsgInterest         = 74;
  ord_WinSetCapture             = 75;
  ord_WinQueryCapture           = 76;
  ord_WinSetFocus               = 77;
  ord_WinQueryFocus             = 78;
  ord_WinSetActiveWindow        = 79;
  ord_WinQueryActiveWindow      = 80;
  ord_WinSetSysModalWindow      = 81;
  ord_WinQuerySysModalWindow    = 82;
  ord_WinIsThreadActive         = 83;
  ord_WinStartTimer             = 84;
  ord_WinStopTimer              = 85;
  ord_WinGetCurrentTime         = 86;
  ord_WinLoadPointer            = 87;
  ord_WinCreatePointer          = 88;
  ord_WinDestroyPointer         = 89;
  ord_OldWinQueryPointerInfo    = 90;
  ord_WinQuerySYSPointer        = 91;
  ord_WinSetPointer             = 92;
  ord_WinQueryPointer           = 93;
  ord_WinShowPointer            = 94;
  ord_WinSetPointerPos          = 95;
  ord_WinQueryPointerPos        = 96;
  ord_WinGetSysBitMap           = 97;
  ord_WinCreateCursor           = 98;
  ord_WinDestroyCursor          = 99;
  ord_WinShowCursor             = 100;
  ord_WinQueryCursorInfo        = 101;
  ord_WinLoadAccelTable         = 102;
  ord_WinCreateAccelTable       = 103;
  ord_WinDestroyAccelTable      = 104;
  ord_WinTRANSLATEAccel         = 105;
  ord_WinSetAccelTable          = 106;
  ord_WinQueryAccelTable        = 107;
  ord_WinCopyAccelTable         = 108;
  ord_WinSetHook                = 109;
  ord_WinReleaseHook            = 110;
  ord_WinOpenClipbrd            = 111;
  ord_WinCloseClipbrd           = 112;
  ord_WinEmptyClipbrd           = 113;
  ord_WinSetClipbrdOwner        = 114;
  ord_WinQueryClipbrdOwner      = 115;
  ord_WinSetClipbrdData         = 116;
  ord_WinQueryClipbrdData       = 117;
  ord_WinEnumClipbrdFmts        = 118;
  ord_WinQueryClipbrdFmtInfo    = 119;
  ord_WinSetClipbrdViewer       = 120;
  ord_WinQueryClipbrdViewer     = 121;
  ord_WinLoadDlg                = 122;
  ord_WinCreateDlg              = 123;
  ord_WinProcessDlg             = 124;
  ord_WinDlgBox                 = 125;
  ord_WinDismissDlg             = 126;
  ord_WinSendDlgItemMsg         = 127;
  ord_WinSetDlgItemShort        = 128;
  ord_WinQueryDlgItemShort      = 129;
  ord_WinMapDlgPoints           = 130;
  ord_WinSubStituteStrings      = 132;
  ord_WinEnumDlgItem            = 133;
  ord_WinSetDlgItemText         = 134;
  ord_WinQueryDlgItemText       = 135;
  ord_WinLoadMenu               = 136;
  ord_WinCreateMenu             = 137;
  ord_WinAlarm                  = 138;
  ord_WinMessageBox             = 139;
  ord_WinCreateStdWindow        = 140;
  ord_WinCreateFrameControls    = 141;
  ord_WinCalcFrameRect          = 143;
  ord_WinFlashWindow            = 144;
  ord_WinGetMinPosition         = 146;
  ord_WinGetMaxPosition         = 147;
  ord_WinQuerySysValue          = 149;
  ord_WinSetSysValue            = 150;
  ord_WinSetSysColors           = 151;
  ord_WinQuerySysColor          = 152;
  ord_WinScrollWindow           = 153;
  ord_WinTrackRect              = 154;
  ord_WinShowTrackRect          = 155;
  ord_GpiLoadBitMap             = 156;
  ord_WinLoadString             = 157;
  ord_WinLoadMessage            = 158;
  ord_WinSetRectEmpty           = 159;
  ord_WinSetRect                = 160;
  ord_WinCopyRect               = 161;
  ord_WinIsRectEmpty            = 162;
  ord_WinEqualRect              = 163;
  ord_WinPtInRect               = 164;
  ord_WinOffsetRect             = 165;
  ord_WinInflateRect            = 166;
  ord_WinIntersectRect          = 167;
  ord_WinUnionRect              = 168;
  ord_WinSubtractRect           = 169;
  ord_WinMakeRect               = 170;
  ord_WinMakePoints             = 171;
  ord_WinInvertRect             = 172;
  ord_WinFillRect               = 173;
  ord_KbdPacket                 = 174;
  ord_WinDrawPointer            = 177;
  ord_WinDefWindowProc          = 178;
  ord_WinDefDlgProc             = 179;
  ord_WinGetKeyState            = 211;
  ord_WinGetPhysKeyState        = 212;
  ord_WinSetKeyBoardStateTable  = 213;
  ord_WinEnablePhysInput        = 214;
  ord_WinSetCP                  = 215;
  ord_WinQueryCP                = 216;
  ord_WinQueryCPList            = 217;
  ord_WinCpTranslateString      = 218;
  ord_WinCpTranslateChar        = 219;
  ord_WinCompareStrings         = 220;
  ord_WinUpper                  = 221;
  ord_WinUpperChar              = 222;
  ord_WinNextChar               = 223;
  ord_WinPrevChar               = 224;
  ord_WinCreateHeap             = 225;
  ord_WinDestroyHeap            = 226;
  ord_WinAvailMem               = 227;
  ord_WinAllocMem               = 228;
  ord_WinReallocMem             = 229;
  ord_WinFreeMem                = 230;
  ord_WinLockHeap               = 231;
  ord_WinCreateAtomTable        = 233;
  ord_WinDestroyAtomTable       = 234;
  ord_WinAddAtom                = 235;
  ord_WinFindAtom               = 236;
  ord_WinDeleteAtom             = 237;
  ord_WinQueryAtomUsage         = 238;
  ord_WinQueryAtomLength        = 239;
  ord_WinQueryAtomName          = 240;
  ord_WinQuerySystemAtomTable   = 241;
  ord_WinGetLastError           = 243;
  ord_WinGetErrorInfo           = 244;
  ord_WinFreeErrorInfo          = 245;
  ord_WinInitialize             = 246;
  ord_WinTerminate              = 247;
  ord_WinCatch                  = 248;
  ord_WinThrow                  = 249;
  ord_WinQueryVersion           = 250;
  ord__WinSetErrorInfo          = 263;
  ord_WinIsPhysInputEnabled     = 264;
  ord_WinQueryWindowDC          = 265;
  ord_WinDrawBorder             = 266;
  ord_WinDrawText               = 267;
  ord_WinDrawBitMap             = 268;
  ord_WinQueryWindowPtr         = 269;
  ord_WinSetWindowPtr           = 270;
  ord_WinMsgSemWait             = 274;
  ord_WinMsgMuxSemWait          = 275;
  ord_WinCancelShutDown         = 277;
  ord_WinSetWindowBits          = 278;
  ord_WinGetClipPS              = 279;
  ord_WinSaveWindowPos          = 285;
  ord_WInFocusChange            = 286;
  ord_WinQueryQueueInfo         = 287;
  ord_WinSetClassMsgInterest    = 292;
  ord_WinQueryDLGItemTextLength = 294;
  ord_WinDDEInitiate            = 297;
  ord_WinDDERespond             = 298;
  ord_WinDDEPostMsg             = 299;
  ord_WinSetPresParam           = 301;
  ord_WinQueryPresParam         = 302;
  ord_WinRemovePresParam        = 303;
  ord_DumWinCreateHelpInstance  = 311;
  ord_DumWinDestroyHelpInstance = 312;
  ord_DumWinAssociateHelpInstance=313;
  ord_DumWinCreateHelpTable     = 314;
  ord_DumWinLoadHelpTable       = 315;
  ord_DumWinQueryHelpInstance   = 316;
  ord_DummyHelpEntry            = 322;
  ord_WinSetClassThunkProc      = 959;
  ord_WinQueryClassThunkProc    = 960;
  ord_WinSetWindowThunkProc     = 961;
  ord_WinQueryWindowThunkProc   = 962;
  ord_WinQueryWindowModeL       = 317;
  ord_WinSetDesktopBkgnd        = 318;
  ord_WinQueryDesktopBkgnd      = 319;
  ord_WinPopupMenu              = 320;
  ord_WinRealizePalette         = 321;
  ord_WinDeleteLibrary          = 602;
  ord_WinLoadProcedure          = 603;
  ord_WinDeleteProcedure        = 604;
  ord_WinSetMsgMode             = 605;
  ord_WinSetSynchroMode         = 606;
  ord_WinGetDlgMsg              = 607;
  ord_WinRegisterUserMsg        = 608;
  ord_WinQueryAnchorBlock       = 609;
  ord_WinRegisterUserDataType   = 612;
  ord_WinIsWindowShowing        = 614;
  ord_WinLoadLibrary            = 615;
  ord_WinCreatePointerIndirect  = 616;
  ord_WinQueryPointerInfo       = 617;
  ord_WinGetErasePS             = 624;
  ord_WinReleaseErasePS         = 625;
  ord_WinStretchPointer         = 632;
  ord_WinSetPointerOwner        = 633;
  ord_Win32AddAtom              = 700;
  ord_Win32Alarm                = 701;
  ord_Win32BeginEnumWindows     = 702;
  ord_Win32BeginPaint           = 703;
  ord_Win32CalcFrameRect        = 704;
  ord_Win32CancelShutDown       = 705;
  ord_Win32CloseClipbrd         = 707;
  ord_Win32CompareStrings       = 708;
  ord_Win32CopyAccelTable       = 709;
  ord_Win32CopyRect             = 710;
  ord_Win32CpTranslateChar      = 711;
  ord_Win32CpTranslateString    = 712;
  ord_Win32CreateAccelTable     = 713;
  ord_Win32CreateAtomTable      = 714;
  ord_Win32CreateCursor         = 715;
  ord_Win32CreateMsgQueue       = 716;
  ord_Win32CreatePointer        = 717;
  ord_Win32DDEInitiate          = 718;
  ord_Win32DDEPostMsg           = 719;
  ord_Win32DDERespond           = 720;
  ord_Win32DeleteAtom           = 721;
  ord_Win32DeleteLibrary        = 722;
  ord_Win32DestroyAccelTable    = 723;
  ord_Win32DestroyAtomTable     = 724;
  ord_Win32DestroyCursor        = 725;
  ord_Win32DestroyMsgQueue      = 726;
  ord_Win32DestroyPointer       = 727;
  ord_Win32DestroyWindow        = 728;
  ord_Win32DismissDlg           = 729;
  ord_Win32DrawBitMap           = 730;
  ord_Win32DrawBorder           = 731;
  ord_Win32DrawPointer          = 732;
  ord_Win32EmptyClipbrd         = 733;
  ord_Win32EnablePhysInput      = 734;
  ord_Win32EnableWindow         = 735;
  ord_Win32EnableWindowUpdate   = 736;
  ord_Win32EndEnumWindows       = 737;
  ord_Win32EndPaint             = 738;
  ord_Win32EnumClipbrdFmts      = 739;
  ord_Win32EnumDlgItem          = 740;
  ord_Win32EqualRect            = 741;
  ord_Win32ExcludeUpdateRegion  = 742;
  ord_Win32FillRect             = 743;
  ord_Win32FindAtom             = 744;
  ord_Win32FlashWindow          = 745;
  ord_Win32FocusChange          = 746;
  ord_Win32FreeErrorInfo        = 748;
  ord_Win32GetClipPS            = 749;
  ord_Win32GetCurrentTime       = 750;
  ord_Win32GetErrorInfo         = 751;
  ord_Win32GetKeyState          = 752;
  ord_Win32GetLastError         = 753;
  ord_Win32GetMaxPosition       = 754;
  ord_Win32GetMinPosition       = 755;
  ord_Win32GetNextWindow        = 756;
  ord_Win32GetPS                = 757;
  ord_Win32GetPhysKeyState      = 758;
  ord_Win32GetScreenPS          = 759;
  ord_Win32GetSysBitMap         = 760;
  ord_Win32InsendMsg            = 761;
  ord_Win32InflateRect          = 762;
  ord_Win32Initialize           = 763;
  ord_Win32IntersectRect        = 764;
  ord_Win32InvalidateRect       = 765;
  ord_Win32InvalidateRegion     = 766;
  ord_Win32InvertRect           = 767;
  ord_Win32IsChild              = 768;
  ord_Win32IsPhysInputEnabled   = 769;
  ord_Win32IsRectEmpty          = 770;
  ord_Win32IsThreadActive       = 771;
  ord_Win32IsWindow             = 772;
  ord_Win32IsWindowEnabled      = 773;
  ord_Win32IsWindowShowing      = 774;
  ord_Win32IsWindowVisible      = 775;
  ord_Win32LoadAccelTable       = 776;
  ord_Win32LoadLibrary          = 777;
  ord_Win32LoadMenu             = 778;
  ord_Win32LoadMessage          = 779;
  ord_Win32LoadPointer          = 780;
  ord_Win32LoadString           = 781;
  ord_Win32LockVisRegions       = 782;
  ord_Win32LockWindowUpdate     = 784;
  ord_Win32MakePoints           = 785;
  ord_Win32MakeRect             = 786;
  ord_Win32MapDlgPoints         = 787;
  ord_Win32MapWindowPoints      = 788;
  ord_Win32MessageBox           = 789;
  ord_Win32MsgSemWait           = 790;
  ord_Win32NextChar             = 791;
  ord_Win32OffsetRect           = 792;
  ord_Win32OpenClipbrd          = 793;
  ord_Win32OpenWindowDC         = 794;
  ord_Win32PrevChar             = 795;
  ord_Win32ProcessDlg           = 796;
  ord_Win32PtInRect             = 797;
  ord_Win32QueryAccelTable      = 798;
  ord_Win32QueryActiveWindow    = 799;
  ord_Win32QueryAnchorBlock     = 800;
  ord_Win32QueryAtomLength      = 801;
  ord_Win32QueryAtomName        = 802;
  ord_Win32QueryAtomUsage       = 803;
  ord_Win32QueryCapture         = 804;
  ord_Win32QueryClassName       = 805;
  ord_Win32QueryClipbrdData     = 806;
  ord_Win32QueryClipbrdFmtInfo  = 807;
  ord_Win32QueryClipbrdOwner    = 808;
  ord_Win32QueryClipbrdViewer   = 809;
  ord_Win32QueryCP              = 810;
  ord_Win32QueryCPList          = 811;
  ord_Win32QueryCursorInfo      = 812;
  ord_Win32QueryDesktopWindow   = 813;
  ord_Win32QueryDlgItemShort    = 814;
  ord_Win32QueryDlgItemText     = 815;
  ord_Win32QueryDlgItemTextLength=816;
  ord_Win32QueryFocus           = 817;
  ord_Win32QueryMsgPos          = 818;
  ord_Win32QueryMsgTime         = 819;
  ord_Win32QueryObjectWindow    = 820;
  ord_Win32QueryPointer         = 821;
  ord_Win32QueryPointerInfo     = 822;
  ord_Win32QueryPointerPos      = 823;
  ord_Win32QueryQueueInfo       = 824;
  ord_Win32QueryQueueStatus     = 825;
  ord_Win32QuerySysColor        = 826;
  ord_Win32QuerySysModalWindow  = 827;
  ord_Win32QuerySysPointer      = 828;
  ord_Win32QuerySysValue        = 829;
  ord_Win32QuerySystemAtomTable = 830;
  ord_Win32QueryUpdateRect      = 831;
  ord_Win32QueryUpdateRegion    = 832;
  ord_Win32QueryVersion         = 833;
  ord_Win32QueryWindow          = 834;
  ord_Win32QueryWindowDC        = 835;
  ord_Win32QueryWindowPos       = 837;
  ord_Win32QueryWindowProcess   = 838;
  ord_Win32QueryWindowPtr       = 839;
  ord_Win32QueryWindowRect      = 840;
  ord_Win32QueryWindowText      = 841;
  ord_Win32QueryWindowTextLength= 842;
  ord_Win32QueryWindowULong     = 843;
  ord_Win32QueryWindowUShort    = 844;
  ord_Win32RegisterUserDataType = 845;
  ord_Win32RegisterUserMsg      = 846;
  ord_Win32ReleasePS            = 848;
  ord_Win32ScrollWindow         = 849;
  ord_Win32SetAccelTable        = 850;
  ord_Win32SetActiveWindow      = 851;
  ord_Win32SetCapture           = 852;
  ord_Win32SetClassMsgInterest  = 853;
  ord_Win32SetClipbrdData       = 854;
  ord_Win32SetClipbrdOwner      = 855;
  ord_Win32SetClipbrdViewer     = 856;
  ord_Win32SetCP                = 857;
  ord_Win32SetDlgItemShort      = 858;
  ord_Win32SetDlgItemText       = 859;
  ord_Win32SetFocus             = 860;
  ord_Win32SetMsgInterest       = 861;
  ord_Win32SetMsgMode           = 862;
  ord_Win32SetMultWindowPos     = 863;
  ord_Win32SetOwner             = 864;
  ord_Win32SetParent            = 865;
  ord_Win32SetPointer           = 866;
  ord_Win32SetPointerPos        = 867;
  ord_Win32SetRect              = 868;
  ord_Win32SetRectEmpty         = 869;
  ord_Win32SetSynchroMode       = 870;
  ord_Win32SetSysColors         = 871;
  ord_Win32SetSysModalWindow    = 872;
  ord_Win32SetSysValue          = 873;
  ord_Win32SetWindowBits        = 874;
  ord_Win32SetWindowPos         = 875;
  ord_Win32SetWindowPtr         = 876;
  ord_Win32SetWindowText        = 877;
  ord_Win32SetWindowULong       = 878;
  ord_Win32SetWindowUShort      = 879;
  ord_Win32ShowCursor           = 880;
  ord_Win32ShowPointer          = 881;
  ord_Win32ShowTrackRect        = 882;
  ord_Win32ShowWindow           = 883;
  ord_Win32StartTimer           = 884;
  ord_Win32StopTimer            = 885;
  ord_Win32SubstituteStrings    = 886;
  ord_Win32SubtractRect         = 887;
  ord_Win32Terminate            = 888;
  ord_Win32TrackRect            = 890;
  ord_Win32UnionRect            = 891;
  ord_Win32UpdateWindow         = 892;
  ord_Win32Upper                = 893;
  ord_Win32UpperChar            = 894;
  ord_Win32ValidateRect         = 895;
  ord_Win32ValidateRegion       = 896;
  ord_Win32WaitMsg              = 897;
  ord_Win32WindowFromDC         = 898;
  ord_Win32WindowFromId         = 899;
  ord_Win32WindowFromPoint      = 900;
  ord_Win32BroadcastMsg         = 901;
  ord_Win32PostQueueMsg         = 902;
  ord_Win32SEndDlgItemMsg       = 903;
  ord_Win32TranslateAccel       = 904;
  ord_Win32CallMsgFilter        = 905;
  ord_Win32CreateFrameControls  = 906;
  ord_Win32CreateMenu           = 907;
  ord_Win32CreateStdWindow      = 908;
  ord_Win32CreateWindow         = 909;
  ord_Win32DefDlgProc           = 910;
  ord_Win32DefWindowProc        = 911;
  ord_Win32DispatchMsg          = 912;
  ord_Win32DrawText             = 913;
  ord_Win32GetDlgMsg            = 914;
  ord_Win32GetMsg               = 915;
  ord_Win32MsgMuxSemWait        = 916;
  ord_Win32MultWindowFromIds    = 917;
  ord_Win32PeekMsg              = 918;
  ord_Win32PostMsg              = 919;
  ord_Win32SEndMsg              = 920;
  ord_Win32SetKeyboardStateTable= 921;
  ord_Win32CreateDlg            = 922;
  ord_Win32DlgBox               = 923;
  ord_Win32LoadDlg              = 924;
  ord_Win32QueryClassInfo       = 925;
  ord_Win32RegisterClass        = 926;
  ord_Win32ReleaseHook          = 927;
  ord_Win32SetHook              = 928;
  ord_Win32SubClassWindow       = 929;
  ord_Win32SetClassThunkProc    = 930;
  ord_Win32QueryClassThunkProc  = 931;
  ord_Win32SetWindowThunkProc   = 932;
  ord_Win32QueryWindowThunkProc = 933;
  ord_Win32QueryWindowModel     = 934;
  ord_Win32SetDesktopBkgnd      = 935;
  ord_Win32QueryDesktopBkgnd    = 936;
  ord_Win32PopupMenu            = 937;
  ord_Win32SetPresParam         = 938;
  ord_Win32QueryPresParam       = 939;
  ord_Win32RemovePresParam      = 940;
  ord_Win32RealizePalette       = 941;
  ord_Win32CreatePointerIndirect= 942;
  ord_Win32SaveWindowPos        = 943;
  ord_Win32GetErasePS           = 952;
  ord_Win32ReleaseErasePS       = 953;
  ord_Win32SetPointerOwner      = 971;
  ord_Win32StretchPointer       = 968;
  ord_Win32SetErrorInfo         = 977;
  ord_Win32WaitEventSem         = 978;
  ord_Win32RequestMutexSem      = 979;
  ord_Win32WaitMuxWaitSem       = 980;
  ord_Win32LoadProcedure        = 986;
  ord_Win32DeleteProcedure      = 987;
{ PMPIC }
  ord_PicPrint                  = 1;
  ord_PicIchg                   = 2;
  ord_Pic32Print                = 11;
  ord_Pic32Ichg                 = 12;
  ord_Prf32Pif2Met              = 13;
{ PMSHAPI }
  ord_WinQueryProfileInt        = 2;
  ord_WinQueryProfileString     = 3;
  ord_WinWriteProfileString     = 4;
  ord_WinQueryProfileSize       = 5;
  ord_WinQueryProfileData       = 6;
  ord_WinWriteProfileData       = 7;
  ord_WinInitSessionMgr         = 8;
  ord_WinSetFgndWindow          = 9;
  ord_WinAddProgram             = 12;
  ord_WinRemoveProgram          = 13;
  ord_WinChangeProgram          = 14;
  ord_WinQueryDefinition        = 15;
  ord_WinQueryProgramTitles     = 16;
  ord_WinCreateGroup            = 17;
  ord_WinAddToGroup             = 19;
  ord_WinQueryProgramUse        = 20;
  ord_WinRemoveFromGroup        = 21;
  ord_WinDestroyGroup           = 23;
  ord_WinQueryFileExtopts       = 24;
  ord_WinSetFileExtopts         = 25;
  ord_WinQueryProgramType       = 26;
  ord_PrfQueryProfileInt        = 32;
  ord_PrfQueryProfileString     = 33;
  ord_PrfWriteProfileString     = 34;
  ord_PrfQueryProfileSize       = 35;
  ord_PrfQueryProfileData       = 36;
  ord_PrfWriteProfileData       = 37;
  ord_PrfOpenProfile            = 38;
  ord_PrfCloseProfile           = 39;
  ord_PrfReset                  = 42;
  ord_PrfQueryProfile           = 43;
  ord_WinInstStartApp           = 44;
  ord_WinTerminateApp           = 45;
  ord_WinCreateSwitchEntry      = 46;
  ord_WinQuerySessionTitle      = 47;
  ord_WinAddSwitchEntry         = 48;
  ord_WinChangeSwitchEntry      = 49;
  ord_PrfAddProgram             = 50;
  ord_PrfRemoveProgram          = 51;
  ord_PrfChangeProgram          = 52;
  ord_PrfQueryDefinition        = 53;
  ord_PrfQueryProgramTitles     = 54;
  ord_PrfCreateGroup            = 55;
  ord_WinQuerySwitchEntry       = 56;
  ord_WinQuerySwitchHandle      = 57;
  ord_PrfQueryProgramHandle     = 58;
  ord_PrfQueryProgramCategory   = 59;
  ord_PrfDestroyGroup           = 60;
  ord_WinQueryTaskTitle         = 65;
  ord_WinQueryTaskSizePos       = 66;
  ord_WinQuerySwitchList        = 67;
  ord_WinRemoveSwitchEntry      = 68;
  ord_WinSWitchToProgram        = 69;
  ord_WinSwitchProgramRegister  = 70;
  ord_WinEndProgram             = 73;
  ord_WinStopProgram            = 74;
  ord_WinEndWindowSession       = 75;
  ord_WinSwitchToTaskManager    = 78;
  ord_WinSwitchToProgram2       = 80;
  ord_WinProcessHotKey          = 81;
  ord_WinInitSession            = 82;
  ord_WinEndSession             = 83;
  ord_WinInitSwEntry            = 84;
  ord_WinSetSwEntry             = 85;
  ord_WinQueryExtIdFocus        = 86;
  ord_WinSetExtIdFocus          = 87;
  ord_WinNoShutdown             = 91;
  ord_WinSetTitle               = 93;
  ord_WinSetTitleAndIcon        = 97;
  ord_Prf32QueryProfileSize     = 101;
  ord_Prf32OpenProfile          = 102;
  ord_Prf32CloseProfile         = 103;
  ord_Prf32RemoveProgram        = 104;
  ord_Prf32DestroyGroup         = 106;
  ord_Prf32QueryProfile         = 107;
  ord_Prf32Reset                = 108;
  ord_Prf32AddProgram           = 109;
  ord_Prf32ChangeProgram        = 110;
  ord_Prf32QueryDefinition      = 111;
  ord_Prf32QueryProgramTitles   = 113;
  ord_Prf32QueryProfileInt      = 114;
  ord_Prf32QueryProfileString   = 115;
  ord_Prf32WriteProfileString   = 116;
  ord_Prf32QueryProfileData     = 117;
  ord_Prf32WriteProfileData     = 118;
  ord_Win32StartApp             = 119;
  ord_Win32AddSwitchEntry       = 120;
  ord_Win32CreateSwitchEntry    = 121;
  ord_Win32QuerySessionTitle    = 122;
  ord_Win32ChangeSwitchEntry    = 123;
  ord_Win32QuerySwitchEntry     = 124;
  ord_Win32QuerySwitchHandle    = 125;
  ord_Win32QuerySwitchKist      = 126;
  ord_Win32QueryTaskSizePos     = 127;
  ord_Win32QueryTaskTitle       = 128;
  ord_Win32RemoveSwitchEntry    = 129;
  ord_Win32TerminateApp         = 130;
  ord_Win32SwitchToProgram      = 131;
  ord_Win32SwitchProgramRegister= 156;
  ord_WinStartApp               = 201;
  ord_WinHAppFromPID            = 208;
  ord_WinHSwitchFromHApp        = 209;
{ QUECALLS }
  ord_DosReadQueue              = 1;
  ord_DosPurgeQueue             = 2;
  ord_DosCloseQueue             = 3;
  ord_DosQueryQueue             = 4;
  ord_DosPeekQueue              = 5;
  ord_DosWriteQueue             = 6;
  ord_DosOpenQueue              = 7;
  ord_DosCreateQueue            = 8;
  ord_Dos32ReadQueue            = 9;
  ord_Dos32PurgeQueue           = 10;
  ord_Dos32CloseQueue           = 11;
  ord_Dos32QueryQueue           = 12;
  ord_Dos32PeekQueue            = 13;
  ord_Dos32WriteQueue           = 14;
  ord_Dos32OpenQueue            = 15;
  ord_Dos32CreateQueue          = 16;
{ SESMGR }
  ord_DosStopSession            = 8;
  ord_DosSelectSession          = 9;
  ord_DosSetSession             = 14;
  ord_DosStartSession           = 17;
  ord_DosSmRegisterDD           = 29;
  ord_Dos32StartSession         = 37;
  ord_Dos32SelectSession        = 38;
  ord_Dos32SetSession           = 39;
  ord_Dos32StopSession          = 40;
{ PMSTDDLG }
  ord_WInFontDlg                = 2;
  ord_WinDefFontDlgProc         = 3;
  ord_WinFileDlg                = 4;
  ord_WinDefFileDlgProc         = 5;
  ord_WinFreeFileDlgList        = 6;
{ VIOCALLS }
  ord_VioEndPopup               = 1;
  ord_VioGetPhysBuf             = 2;
  ord_VioGetAnsi                = 3;
  ord_VioSetAnsi                = 5;
  ord_VioDeRegister             = 6;
  ord_VioScrollUp               = 7;
  ord_VioPrtSc                  = 8;
  ord_VioGetCurPos              = 9;
  ord_VioWrtCellStr             = 10;
  ord_VioPopup                  = 11;
  ord_VioScrollRt               = 12;
  ord_VioWrtCharStr             = 13;
  ord_VioSetCurPos              = 15;
  ord_VioScrUnlock              = 18;
  ord_VioWrtTTY                 = 19;
  ord_VioGetMode                = 21;
  ord_VioSetMode                = 22;
  ord_VioScrLock                = 23;
  ord_VioReadCellStr            = 24;
  ord_VioSavRedrawWait          = 25;
  ord_VioWrtNAttr               = 26;
  ord_VioGetCurType             = 27;
  ord_VioSavRedrawUndo          = 28;
  ord_VioGetFont                = 29;
  ord_VioReadCharStr            = 30;
  ord_VioGetBuf                 = 31;
  ord_VioSetCurType             = 32;
  ord_VioSetFont                = 33;
  ord_VioModeUndo               = 35;
  ord_VioModeWait               = 37;
  ord_VioGetCP                  = 40;
  ord_VioSetCP                  = 42;
  ord_VioShowBuf                = 43;
  ord_VioScrollLf               = 44;
  ord_VioRegister               = 45;
  ord_VioGetConfig              = 46;
  ord_VioScrollDn               = 47;
  ord_VioWrtCharStrAtt          = 48;
  ord_VioGetState               = 49;
  ord_VioPrtScToggle            = 50;
  ord_VioSetState               = 51;
  ord_VioWrtNCell               = 52;
  ord_VioWrtNChar               = 53;
  ord_VioAssociate              = 55;
  ord_VioCreatePS               = 56;
  ord_VioDeleteSetID            = 57;
  ord_VioGetDeviceCellSize      = 58;
  ord_VioGetOrg                 = 59;
  ord_VioCreateLogFont          = 60;
  ord_VioDestroyPS              = 61;
  ord_VioQuerySetIds            = 62;
  ord_VioSetOrg                 = 63;
  ord_VioQueryFonts             = 64;
  ord_VioSetDeviceCellSize      = 65;
  ord_VioShowPS                 = 66;
  ord_VioGetPSAddress           = 67;
  ord_VioGlobalReg              = 70;
  ord_XVioSetCAState            = 71;
  ord_XVioCheckCharType         = 72;
  ord_XVioDestroyCA             = 73;
  ord_XVioCreateCA              = 74;
  ord_VioCheckCharType          = 75;
  ord_XVioGetCAState            = 76;
{ PMVIOP }
  ord_WinDefAVioWindowProc      = 30;

{----[ BaseMid ]----}
{ Message numbers in the OS/2 .MSG file }

  msg_Response_Data             = 0;
  msg_Invalid_Function          = 1;
  msg_File_Not_Found            = 2;
  msg_Path_Not_Found            = 3;
  msg_Out_Of_Handles            = 4;
  msg_Access_Denied             = 5;
  msg_Invalid_Handle            = 6;
  msg_Memory_Blocks_Bad         = 7;
  msg_No_Memory                 = 8;
  msg_Invalid_Mem_Addr          = 9;
  msg_Invalid_Environ           = 10;
  msg_Invalid_Format            = 11;
  msg_Invalid_Acc_Code          = 12;
  msg_Invalid_Data              = 13;
  msg_Invalid_Drive             = 15;
  msg_Att_Rd_Curdir             = 16;
  msg_Not_Same_Device           = 17;
  msg_No_More_Files             = 18;
  msg_Att_Write_Prot            = 19;
  msg_Unknown_Unit              = 20;
  msg_Drive_Not_Ready           = 21;
  msg_Unknown_Command           = 22;
  msg_Data_Error                = 23;
  msg_Bad_Req_Structure         = 24;
  msg_Seek_Error                = 25;
  msg_Unknown_Media             = 26;
  msg_Sector_Not_Found          = 27;
  msg_Out_Of_Paper              = 28;
  msg_Write_Fault               = 29;
  msg_Read_Fault                = 30;
  msg_General_Failure           = 31;
  msg_Sharing_Violation         = 32;
  msg_Shar_Violat_Find          = 32;
  msg_Lock_Violation            = 33;
  msg_Invalid_Disk_Change       = 34;
  msg_35                        = 35;
  msg_Sharing_Buff_Oflow        = 36;
  msg_Error_Write_Protect       = 37;
  msg_Error_Bad_Unit            = 38;
  msg_Error_Not_Ready           = 39;
  msg_Error_Bad_Command         = 40;
  msg_Error_CRC                 = 41;
  msg_Error_Bad_Length          = 42;
  msg_Error_Seek                = 43;
  msg_Error_Not_Dos_Disk        = 44;
  msg_Error_Sector_Not_Found    = 45;
  msg_Error_Out_Of_Paper        = 46;
  msg_Error_Write_Fault         = 47;
  msg_Error_Read_Fault          = 48;
  msg_Error_Gen_Failure         = 49;
  msg_Net_Req_Not_Support       = 50;
  msg_Net_Remote_Not_Online     = 51;
  msg_Net_Dup_FilenamE          = 52;
  msg_Net_Path_Not_Found        = 53;
  msg_Net_Busy                  = 54;
  msg_Net_Dev_Not_Installed     = 55;
  msg_Net_Bios_Limit_Reached    = 56;
  msg_Net_Adapt_Hrdw_Error      = 57;
  msg_Net_Incorrect_Response    = 58;
  msg_Net_Unexpect_Error        = 59;
  msg_Net_Remot_Adpt_Incomp     = 60;
  msg_Net_Print_Q_Full          = 61;
  msg_Net_No_Space_To_Print_Fl  = 62;
  msg_Net_Print_File_Deleted    = 63;
  msg_Net_Name_Deleted          = 64;
  msg_Net_Access_Denied         = 65;
  msg_Net_Dev_Type_Invalid      = 66;
  msg_Net_Name_Not_Found        = 67;
  msg_Net_Name_Limit_Exceed     = 68;
  msg_Net_Bios_Limit_Exceed     = 69;
  msg_Net_Temp_Paused           = 70;
  msg_Net_Request_Denied        = 71;
  msg_Net_Prt_Dsk_Redir_Pause   = 72;
  msg_XGA_Out_Memory            = 75;
  msg_File_Exists               = 80;
  msg_Cannot_Make               = 82;
  msg_Net_Fail_Int_Two_Four     = 83;
  msg_Net_Too_Many_Redirect     = 84;
  msg_Net_Dup_Redirection       = 85;
  msg_Net_Invalid_PassWord      = 86;
  msg_Net_Incorr_Parameter      = 87;
  msg_Net_Data_Fault            = 88;
  msg_No_Proc_Slots             = 89;
  msg_Device_In_Use             = 99;
  msg_Too_Many_Semaphores       = 100;
  msg_Excl_Sem_Already_Owned    = 101;
  msg_Sem_Is_Set                = 102;
  msg_Too_Many_Sem_Requests     = 103;
  msg_Invalid_At_Interrupt_Time = 104;
  msg_Sem_Owner_Died            = 105;
  msg_Error_Disk_Change         = 106;
  msg_Disk_Change               = 107;
  msg_Drive_Locked              = 108;
  msg_Broken_Pipe               = 109;
  msg_Error_Open_Failed         = 110;
  msg_Error_Filename_Long       = 111;
  msg_Disk_Full                 = 112;
  msg_No_Search_Handles         = 113;
  msg_Err_Inv_Tar_Handle        = 114;
  msg_Invalid_Category          = 117;
  msg_Invalid_Verify_Switch     = 118;
  msg_Bad_Driver_Level          = 119;
  msg_Bad_DynaLink              = 120;
  msg_Sem_Timeout               = 121;
  msg_Insufficient_Buffer       = 122;
  msg_Invalid_Name              = 123;
  msg_HPFS_Invalid_Volume_Char  = 123;
  msg_Invalid_Level             = 124;
  msg_No_Volume_Label           = 125;
  msg_Mod_Not_Found             = 126;
  msg_Proc_Not_Found            = 127;
  msg_Prot_Mode_Only            = 129;
  msg_Appl_SingleFrameChar      = 130;
  msg_Appl_DoubleFrameChar      = 131;
  msg_Appl_ArrowChar            = 132;
  msg_Join_On_Driv_Is_Tar       = 133;
  msg_Join_Drive_Is             = 134;
  msg_Sub_Drive_Is              = 135;
  msg_Drive_Is_Not_Joined       = 136;
  msg_Drive_Not_Substed         = 137;
  msg_Join_Cannot_Join_Drive    = 138;
  msg_Sub_Cannot_Subst_Drive    = 139;
  msg_Join_Cannot_Sub_Drive     = 140;
  msg_Sub_Cannot_Join_Drive     = 141;
  msg_Drive_Is_Busy             = 142;
  msg_Join_Sub_Same_Drive       = 143;
  msg_Direct_Is_Not_Subdir      = 144;
  msg_Direct_Is_Not_Empty       = 145;
  msg_Path_Used_Subst_Join      = 146;
  msg_No_Needed_Resources       = 147;
  msg_Path_Busy                 = 148;
  msg_Sub_On_Drive_Is_Join      = 149;
  msg_System_Trace              = 150;
  msg_Invalid_Event_Count       = 151;
  msg_Too_Many_MuxWaiters       = 152;
  msg_Invalid_List_Format       = 153;
  msg_Volume_Too_Long           = 154;
  msg_HPFS_Vol_Label_Long       = 154;
  msg_Too_Many_Tcbs             = 155;
  msg_Signal_Refused            = 156;
  msg_Discarded                 = 157;
  msg_Not_Locked                = 158;
  msg_Bad_ThreadID_Addr         = 159;
  msg_Bad_Arguments             = 160;
  msg_Signal_Pending            = 162;
  msg_Max_Thrds_Reached         = 164;
  msg_Unc_Driver_Not_Installed  = 166;
  msg_Lock_Failed               = 167;
  msg_SwapIO_Failed             = 168;
  msg_SwapIn_Attempt_Failed     = 169;
  msg_Segment_Busy              = 170;
  msg_Int_Too_Long              = 171;
  msg_Unlock_Violation          = 173;
  msg_Invalid_Segment_Num       = 180;
  msg_Invalid_OrdinaL           = 182;
  msg_Invalid_Flag_Number       = 186;
  msg_Sem_Not_Found             = 187;
  msg_Invalid_Starting_CodeSeg  = 188;
  msg_Invalid_StackSeg          = 189;
  msg_Invalid_ModuleType        = 190;
  msg_Invalid_Exe_Signature     = 191;
  msg_Exe_Marked_Invalid        = 192;
  msg_Bad_Exe_Format            = 193;
  msg_Iterated_Data_Exceeds_64K = 194;
  msg_Invalid_MinAllocSize      = 195;
  msg_DynLink_From_Invalid_Ring = 196;
  msg_IOPL_Not_Enabled          = 197;
  msg_Invalid_SegDPL            = 198;
  msg_AutoDataSeg_Exceeds_64K   = 199;
  msg_CodeSeg_Cannot_Be_64K     = 200;
  msg_Reloc_Chain_Xeeds_Segment = 201;
  msg_Infloop_In_Reloc_Chain    = 202;
  msg_EnvVar_Not_Found          = 203;
  msg_Signal_Not_Sent           = 205;
  msg_Name_Too_Long             = 206;
  msg_Ring2_Stack_In_Use        = 207;
  msg_Wild_Card_Name            = 208;
  msg_Invalid_Signal_NumBER     = 209;
  msg_Thread_1_Inactive         = 210;
  msg_Locked                    = 212;
  msg_Too_Many_Modules          = 214;
  msg_Cannot_Shrink             = 216;
  msg_Invalid_ExitRoutine_Ring  = 219;
  msg_No_Children               = 228;
  msg_Error_Bad_Pipe            = 230;
  msg_Error_Pipe_Busy           = 231;
  msg_Error_No_Data             = 232;
  msg_Error_Pipe_Not_Connected  = 233;
  msg_Error_More_Data           = 234;
  msg_Error_VC_Disconnected     = 240;
  msg_Circularity_Requested     = 250;
  msg_Directory_In_CDS          = 251;
  msg_Invalid_Fsd_Name          = 252;
  msg_Invalid_Path              = 253;
  msg_Invalid_EA_Name           = 254;
  msg_EA_List_Inconsistent      = 255;
  msg_EA_List_Too_Long          = 256;
  msg_No_Meta_Match             = 257;
  msg_FindNotify_Timeout        = 258;
  msg_No_More_Items             = 259;
  msg_Search_Struc_Reused       = 260;
  msg_Char_Not_Found            = 261;
  msg_Too_Much_Stack            = 262;
  msg_Invalid_Attr              = 263;
  msg_Invalid_Starting_Ring     = 264;
  msg_Invalid_DLL_Init_Ring     = 265;
  msg_Cannot_Copy               = 266;
  msg_Directory                 = 267;
  msg_OpLocked_File             = 268;
  msg_OpLock_Thread_Exists      = 269;
  msg_Error_EAs_Corrupt         = 276;
  msg_EA_Table_Full             = 277;
  msg_Invalid_EA_Handle         = 278;
  msg_No_Cluster                = 279;
  msg_Error_Create_EA_File      = 280;
  msg_Cannot_Open_File          = 281;
  msg_EAs_Not_Supported         = 282;
  msg_Need_EAs_Found            = 283;
  msg_EAs_Discarded             = 284;
  msg_Duplicate_Sem_Name        = 285;
  msg_Empty_MuxWait_Sem         = 286;
  msg_Mutex_Sem_Owned           = 287;
  msg_Not_Mutex_Sem_Owner       = 288;
  msg_Query_Mux_Param_Too_Small = 289;
  msg_Too_Many_Sem_Handles      = 290;
  msg_Too_Many_Sem_Opens        = 291;
  msg_Sem_Wrong_Type            = 292;
  msg_Too_Many_Event_Sem_Posts  = 298;
  msg_Event_Sem_Already_Posted  = 299;
  msg_Event_Sem_Already_Reset   = 300;
  msg_Sem_Busy                  = 301;
  msg_MR_Msg_Too_Long           = 316;
  msg_MR_Cant_Format            = 317;
  msg_MR_Not_Found              = 318;
  msg_MR_Read_Error             = 319;
  msg_MR_Ivcount_Error          = 320;
  msg_MR_Un_Perform             = 321;
  msg_Que_Proc_Not_Owned        = 330;
  msg_Que_Duplicate             = 332;
  msg_Que_Element_Not_Exist     = 333;
  msg_Que_No_Memory             = 334;
  msg_Vio_Invalid_Mask          = 349;
  msg_Vio_Ptr                   = 350;
  msg_Dis_Error                 = 355;
  msg_Vio_Width                 = 356;
  msg_Vio_Row                   = 358;
  msg_Vio_Col                   = 359;
  msg_Vio_Wait_Flag             = 366;
  msg_Vio_UNLOCK                = 367;
  msg_Smg_Invalid_Session_Id    = 369;
  msg_Smg_Grp_Not_Found         = 371;
  msg_Smg_Session_Not_Found     = 371;
  msg_Smg_Set_Title             = 372;
  msg_Kbd_Parameter             = 373;
  msg_Kbd_Invalid_IoWait        = 375;
  msg_Kbd_Invalid_Length        = 376;
  msg_Kbd_Invalid_Echo_Mask     = 377;
  msg_Kbd_Invalid_Input_Mask    = 377;
  msg_Mon_Invalid_Parms         = 379;
  msg_Mon_Invalid_DevName       = 380;
  msg_Mon_Invalid_Handle        = 381;
  msg_Mon_Buffer_Too_Small      = 382;
  msg_Mon_Buffer_Empty          = 383;
  msg_Mon_Data_Too_Large        = 384;
  msg_Mouse_No_Device           = 385;
  msg_Mouse_Inv_Handle          = 386;
  msg_Mouse_Caller_Not_SybSys   = 387;
  msg_NLS_No_Country_File       = 396;
  msg_No_Country_Sys            = 396;
  msg_NLS_Open_Failed           = 397;
  msg_Open_Country_Sys          = 397;
  msg_NLS_No_Ctry_Code          = 398;
  msg_No_Country_OR_Codepage    = 398;
  msg_NLS_Table_Truncated       = 399;
  msg_NLS_Bad_Type              = 400;
  msg_NLS_Type_Not_Found        = 401;
  msg_Country_No_Type           = 401;
  msg_SwapIn_Failed             = 402;
  msg_SegValidate_Failure       = 403;
  msg_Vio_DeRegister            = 404;
  msg_Vio_No_Popup              = 405;
  msg_Vio_Existing_PopUp        = 406;
  msg_Kbd_Smg_Only              = 407;
  msg_Kbd_Invalid_Asciiz        = 408;
  msg_Kbd_Invalid_Mask          = 409;
  msg_Kbd_Register              = 410;
  msg_Kbd_Deregister            = 411;
  msg_Mouse_Smg_Only            = 412;
  msg_Mouse_Invalid_Asciiz      = 413;
  msg_Mouse_Invalid_Mask        = 414;
  msg_Mouse_Register            = 415;
  msg_Mouse_Deregister          = 416;
  msg_Smg_Bad_ACTION            = 417;
  msg_Smg_Invalid_Call          = 418;
  msg_Vio_Invalid_Parms         = 421;
  msg_Vio_Function_Owned        = 422;
  msg_Vio_Register              = 426;
  msg_Vio_No_Save_Restore_Thd   = 428;
  msg_Vio_In_BG                 = 429;
  msg_Vio_Illegal_During_PopUp  = 430;
  msg_Smg_Not_BaseShell         = 431;
  msg_Smg_Bad_StatusReq         = 432;
  msg_Vio_Lock                  = 434;
  msg_Mouse_Invalid_IoWait      = 435;
  msg_Vio_Invalid_Handle        = 436;
  msg_Vio_Invalid_Length        = 438;
  msg_Kbd_Invalid_Handle        = 439;
  msg_Kbd_No_More_Handle        = 440;
  msg_Kbd_Cannot_Create_Kcb     = 441;
  msg_Kbd_CodePage_Load_Incompl = 442;
  msg_Kbd_Invalid_CodePage_Id   = 443;
  msg_Kbd_No_CodePage_Support   = 444;
  msg_Kbd_Focus_Required        = 445;
  msg_Kbd_Focus_Already_Active  = 446;
  msg_Kbd_Keyboard_Busy         = 447;
  msg_Kbd_Invalid_CodePage      = 448;
  msg_Kbd_Unable_To_Focus       = 449;
  msg_Smg_Session_Non_Select    = 450;
  msg_Smg_Session_Not_Foregrnd  = 451;
  msg_Smg_Session_Not_Parent    = 452;
  msg_Smg_Invalid_Start_Mode    = 453;
  msg_Smg_Invalid_Related_Opt   = 454;
  msg_Smg_Invalid_Bond_Option   = 455;
  msg_Smg_Invalid_Select_Opt    = 456;
  msg_Smg_Start_In_Background   = 457;
  msg_Smg_Invalid_Stop_Option   = 458;
  msg_Smg_Bad_Reserve           = 459;
  msg_Smg_Process_Not_Parent    = 460;
  msg_Smg_Invalid_Data_Length   = 461;
  msg_Smg_Not_Bound             = 462;
  msg_Smg_Retry_Sub_Alloc       = 463;
  msg_Kbd_Detached              = 464;
  msg_Vio_Detached              = 465;
  msg_Mou_Detached              = 466;
  msg_Vio_Font                  = 467;
  msg_Vio_User_Font             = 468;
  msg_Vio_Bad_Cp                = 469;
  msg_Vio_NA_Cp                 = 471;
  msg_Smg_Invalid_Trace_OPTION  = 478;
  msg_Vio_Shell_Init            = 480;
  msg_Smg_No_Hard_Errors        = 481;
  msg_Vio_Transparent_PopUp     = 483;
  msg_Vio_Bad_Reserve           = 486;
  msg_Invalid_Address           = 487;
  msg_Zero_Selectors_Requested  = 488;
  msg_Not_Enough_Selectors_Ava  = 489;
  msg_Invalid_Selector          = 490;
  msg_Smg_Invalid_Program_Type  = 491;
  msg_Smg_Invalid_Pgm_Control   = 492;
  msg_Smg_Invalid_Inherit_Opt   = 493;
  msg_Vio_Extended_Sg           = 494;
  msg_Vio_Not_Pres_Mgr_Sg       = 495;
  msg_Vio_Shield_Owned          = 496;
  msg_Vio_No_More_Handles       = 497;
  msg_Kbd_No_Console            = 500;
  msg_Dos_Stopped               = 501;
  msg_Mouse_Invalid_Handle      = 502;
  msg_Smg_Invalid_Debug_Parms   = 503;
  msg_Kbd_Extended_SG           = 504;
  msg_Mou_Extended_SG           = 505;
  msg_Trc_Pid_Non_Existent      = 507;
  msg_Trc_Count_Active          = 508;
  msg_Trc_Suspended_By_Count    = 509;
  msg_Trc_Count_Inactive        = 510;
  msg_Trc_Count_Reached         = 511;
  msg_No_Mc_Trace               = 512;
  msg_MC_Trace                  = 513;
  msg_Trc_Count_Zero            = 514;
  msg_Smg_Too_Many_Dds          = 515;
  msg_Smg_Invalid_Notification  = 516;
  msg_LF_Invalid_Function       = 517;
  msg_LF_Not_Avail              = 518;
  msg_LF_Suspended              = 519;
  msg_LF_Buf_Too_Small          = 520;
  msg_LF_Buf_Full               = 521;
  msg_LF_Inval_Record           = 522;
  msg_LF_Inval_Service          = 523;
  msg_LF_General_Failure        = 524;
  msg_HPFS_Disk_Already_InUse   = 525;
  msg_HPFS_Cannot_Format_Disk   = 526;
  msg_HPFS_Cannot_Copy_Sys_Data = 527;
  msg_HPFS_Format_Not_Done      = 528;
  msg_HPFS_Fmt_Not_Enough_Mem   = 529;
  msg_HPFS_Specify_FixDsk       = 530;
  msg_HPFS_Specify_One_Drive    = 531;
  msg_HPFS_Unknown_Err_No_Format= 532;
  msg_HPFS_Syntax_Help          = 533;
  msg_HPFS_Disk_Formating       = 534;
  msg_HPFS_Avail_Disk_Space     = 535;
  msg_HPFS_Bad_Blocks           = 536;
  msg_HPFS_Disk_Space_Avail     = 537;
  msg_HPFS_Space_Formatted      = 538;
  msg_HPFS_Type_Cur_Volume_Label= 539;
  msg_HPFS_Driver_Not_Loaded    = 540;
  msg_HPFS_Driver_Loader        = 541;
  msg_HPFS_Cache_Buf_Specified  = 542;
  msg_HPFS_ChkDsk_Parm_Error    = 543;
  msg_HPFS_ChkDsk_NoAccess_Drive= 544;
  msg_HPFS_Unknown_Err_No_ChkDsk= 545;
  msg_HPFS_ChkDsk_Not_Enough_Mem= 546;
  msg_HPFS_ChkDsk_NoWriteOData  = 547;
  msg_HPFS_ChkDsk_NoRecover_Data= 548;
  msg_HPFS_ChkDsk_No_Parm_Space = 549;
  msg_HPFS_ChkDsk_NoRecognize   = 550;
  msg_HPFS_ChkDsk_NoRoot_Find   = 551;
  msg_HPFS_ChkDsk_NoFix_FS_Error= 552;
  msg_HPFS_ChkDsk_Correct_FS_Err= 553;
  msg_HPFS_ChkDsk_Organ_Fix     = 554;
  msg_HPFS_ChkDsk_Reloc_BBPData = 555;
  msg_HPFS_ChkDsk_Rem_Corru_Bloc= 556;
  msg_HPFS_ChkDsk_Rem_Corrup_Fil= 557;
  msg_HPFS_ChkDsk_Fix_Space_Allo= 558;
  msg_HPFS_Not_Formatted_Disk   = 559;
  msg_HPFS_ChkDsk_Cor_Alloc     = 560;
  msg_HPFS_ChkDsk_Searc_Unalloc = 561;
  msg_HPFS_ChkDsk_Det_Lost_Data = 562;
  msg_HPFS_ChkDsk_Percent_Searc = 563;
  msg_HPFS_ChkDsk_Lost_Datasearc= 564;
  msg_HPFS_ChkDsk_Crit_NoRead   = 565;
  msg_HPFS_ChkDsk_Disk_InUse    = 566;
  msg_HPFS_ChkDsk_RecovTemp_Reloc = 567;
  msg_HPFS_Total_Disk_Space     = 568;
  msg_HPFS_Dir_kBytes           = 569;
  msg_HPFS_File_kBytes          = 570;
  msg_HPFS_kBytes_Available     = 571;
  msg_HPFS_ChkDsk_Place_Rec_File= 572;
  msg_HPFS_ChkDsk_Reco_Dir_As   = 573;
  msg_HPFS_ChkDsk_PlaceEd_Data  = 574;
  msg_HPFS_ChkDsk_Recov_EA      = 575;
  msg_HPFS_ChkDsk_Find_EA_Intem = 576;
  msg_HPFS_ChkDsk_Reloc_Temp_EA = 577;
  msg_HPFS_ChkDsk_Reloc_AC_List = 578;
  msg_HPFS_ChkDsk_List_NoReloc  = 579;
  msg_HPFS_ChkDsk_Trun_EA_List  = 580;
  msg_HPFS_ChkDsk_Trun_EA_Name  = 581;
  msg_HPFS_ChkDsk_Trun_EA_Bblock= 582;
  msg_HPFS_ChkDsk_Rem_Invalid_EA= 583;
  msg_HPFS_ChkDsk_Fix_EA_Alloc  = 584;
  msg_HPFS_ChkDsk_Fix_Alaccctrl = 585;
  msg_HPFS_ChkDsk_Acctr_List_BBL= 586;
  msg_HPFS_ChkDsk_Rem_Aclist    = 587;
  msg_HPFS_ChkDsk_Found_DataNorl= 588;
  msg_HPFS_Wrong_Version        = 589;
  msg_HPFS_ChkDsk_Found_DataTemp= 590;
  msg_HPFS_ChkDsk_Fix_TempStatus= 591;
  msg_HPFS_ChkDsk_Fix_NeedEAdata= 592;
  msg_HPFS_Recover_Parm_Error   = 593;
  msg_HPFS_Recov_File_Not_Found = 594;
  msg_HPFS_Recov_Unknown_Error  = 595;
  msg_HPFS_Recov_Not_Enough_Mem = 596;
  msg_HPFS_Recov_NoWrite_Data   = 597;
  msg_HPFS_Recov_NoTemp_Create  = 598;
  msg_HPFS_Recov_EA_NoRead      = 599;
  msg_HPFS_Recov_File_Bytes     = 600;
  msg_HPFS_Recov_Bad_Bytes_Recov= 601;
  msg_HPFS_Recov_FileBytes_Norec= 602;
  msg_HPFS_Recov_Disk_InUse     = 603;
  msg_HPFS_Recov_File_NoDelete  = 604;
  msg_HPFS_Recov_NoCreate_NewFile = 605;
  msg_HPFS_Recov_System_Error   = 606;
  msg_HPFS_Sys_Parm_Error       = 607;
  msg_HPFS_Sys_Cannot_Install   = 608;
  msg_HPFS_Sys_Drive_NotFormated= 609;
  msg_HPFS_Sys_File_NoCreate    = 610;
  msg_HPFS_Size_Exceed          = 611;
  msg_HPFS_Syntax_Err           = 612;
  msg_HPFS_NotEnough_Mem        = 613;
  msg_HPFS_Want_Mem             = 614;
  msg_HPFS_Get_Returned         = 615;
  msg_HPFS_Set_Returned         = 616;
  msg_HPFS_Both_Returned        = 617;
  msg_HPFS_Stop_Returned        = 618;
  msg_HPFS_SetPrtyReturned      = 619;
  msg_HPFS_Alcsg_Returned       = 620;
  msg_HPFS_Msec_Set             = 621;
  msg_HPFS_Options              = 622;
  msg_HPFS_Pos_Num_Value        = 623;
  msg_HPFS_Value_Too_Large      = 624;
  msg_HPFS_Lazy_Not_Valid       = 625;
  msg_HPFS_Volume_Error         = 626;
  msg_HPFS_Volume_Dirty         = 627;
  msg_HPFS_New_Sector           = 628;
  msg_HPFS_Format_Parm_Error    = 629;
  msg_HPFS_Cannot_Access_Config = 630;
  msg_HPFS_Recov_File           = 631;
  msg_HPFS_ChkDsk_kBytes_Reserve= 632;
  msg_HPFS_ChkDsk_kBytes_In_EA  = 633;
  msg_HPFS_Bytebuf_Set          = 634;
  msg_HPFS_Formatting_Complete  = 635;
  msg_HPFS_Wrong_Volume_Label   = 636;
  msg_HPFS_Fmat_Too_Many_DRS    = 637;
  msg_Vdd_Unsupported_Access    = 638;
  msg_REC_Warning               = 640;              { 81565 }
  msg_Vdd_Missing               = 651;
  msg_HPFS_Lazy_On              = 689;
  msg_HPFS_Lazy_Off             = 690;
  msg_HPFS_Disk_Error_Warn      = 693;
  msg_Bad_Mon_Buffer            = 730;
  msg_Module_Corrupted          = 731;
  msg_Boot_Drive_Not_Accessible = 732;              { 86415,86005,85898 }
  msg_LF_Timeout                = 2055;
  msg_LF_Susp_Success           = 2057;
  msg_LF_Resum_Success          = 2058;
  msg_LF_Redir_Success          = 2059;
  msg_LF_Redir_Failure          = 2060;

  { 0 - 899 generated from bseerr.h by h.mak and basemid.sed }

  { 900 - 999 reserved for IBM Far East }
  { 1000 not used }
  msg_Bad_PARM1                 = 1001;     { invalid parm }
  msg_Bad_PARM2                 = 1002;     { invalid parm with specified input }
  msg_Bad_Syntax                = 1003;     { invalid syntax }
  msg_STAND_BY                  = 1004;     { stand by the process is in process }
  msg_Invalid_DATE              = 1036;     { invalid date }
  msg_Dev_INSTALL_FAIL          = 1111;     { device name from the header }
  msg_Dev_AT_ONLY               = 1112;     { non-ABIOS type driver installed }
  msg_Dev_PS2_ONLY              = 1113;     { ABIOS installed on an AT }
  msg_Dev_HW_UNSUPPORTED        = 1114;     { bad or imcompatable card }
  msg_Dev_HW_UNAVAILABLE        = 1115;     { adaptor not installed }
  msg_Dev_IRQ                   = 1116;     { IRQ call failed }
  msg_Dev_ABIOS                 = 1117;     { ABIOS not present error }
  msg_No_HELP_MSG               = 1118;     { no help msg. ID }
  { 1119 not used }
  msg_NEXT_DiskETTE             = 1120;     { Sys load next disk }
  { 1121 - 1190 not used }
  msg_SysInit_No_IFS_STMT       = 1191;     { no IFS statment in config.sys }
  msg_SysInit_287_DISABLED      = 1193;
  msg_SysInit_387_WITH_386B1    = 1194;
  msg_SysInit_INVAL_CMD         = 1195;     { Unrecognized command }
  msg_SysInit_INVAL_PARM        = 1196;     { Invalid parameter }
  msg_SysInit_MISSING_PARM      = 1197;     { Missing parameter }
  msg_SysInit_Bad_DOS_DD        = 1198;     { invalid DOS mode device driver }
  msg_SysInit_BOOT_Failure      = 1199;     { sys unable to start OS/2 }
  msg_SysInit_DOS_FAIL          = 1200;     { Cannot create DOS mode }
  msg_SysInit_UDRVR_FAIL        = 1201;     { user device driver failed to install }
  msg_SysInit_SDRVR_FAIL        = 1202;     { system device driver failed to install }
  msg_SysInit_UFILE_IOPL        = 1203;     { User file requires privilege level }
  msg_SysInit_SFILE_IOPL        = 1204;     { System file requires privilege level }
  msg_SysInit_DOS_MODIFIED      = 1205;     { DOS mode memory modified by DD }
  msg_SysInit_UFILE_No_MEM      = 1206;     { Out of memory loading user program or DD }
  { 1207 not used }
  msg_Incorrect_DOSVERSION      = 1210;     { incorrect DOS version }
  msg_ABORT_RTRY_IGNORE         = 1211;     { abort, retry, or ignore }
  msg_HPFS_Format_YES_No        = 1271;     { format disk, yes or no }
  msg_HPFS_Sys_Files_COPIED     = 1272;     { system files transferred }
  msg_HPFS_Bad_Blocks_CRIT_AREA = 1279;     { bad blocks in critical system areas }
  msg_HPFS_TYPE_Volume_Label    = 1288;     { Enter volume label }
  msg_HPFS_Specify_Drive_LETTER = 1310;     { FORMAT entered without drive letter, specify }
  msg_HPFS_DIRECTORY            = 1338;     { directory }
  msg_HPFS_ChkDsk_NoREAD_Data   = 1341;     { cannot read disk data }

  msg_SAD_Remote_DUMP           = 1394;     { remote dump initiated }
  msg_SAD_INSERT_DUMP           = 1395;     { insert dump disk - rasmsg }
  msg_SAD_Not_AVAILABLE         = 1398;     { dump not available }

  msg_DLL_CANT_LOAD_RESOURCE    = 1417;     { app resources not available }

  msg_SWAP_Invalid_Drive        = 1470;     { Invalid drive %1 specified SWAPPATH }
  msg_SWAP_Invalid_PATH         = 1471;     { Invalid path %1 specified in SWAPPATH }
  msg_SWAP_Cannot_Create        = 1472;     { Cannot create swap file %1 }
  msg_SWAP_DISABLED             = 1473;     { Segment swapping is disabled }
  msg_SWAP_CANT_INIT            = 1474;     { Cannot initialize swapper }
  msg_SysInit_BOOT_Not_FD       = 1475;
  msg_SWAP_Invalid_Path_ROOT    = 1476;     { invalid path %1 specified, use root }
  msg_STRI_File_Not_Found       = 1490;     { %1 file not found }
  msg_SWAP_Not_Ready            = 1500;     { diskette containing swap file not rdy }
  msg_SWAP_Write_ProtECT        = 1501;     { Diskette containing swap file wrpro }
  msg_SWAP_In_Error             = 1502;     { I/O error on swap file }
  msg_SWAP_IO_Error             = 1502;     { I/O error on swap file }
  msg_SWAP_File_Full            = 1503;     { Swap file is full }
  msg_SWAP_Table_Full           = 1504;     { Swap control table full }
  { 1517 not used }
  msg_SysInit_SFILE_Not_FND     = 1518;     { System file not found }
  msg_SysInit_SFILE_No_MEM      = 1519;     { Out of memory loading system program or DD }
  msg_SysInit_DSKT_Not_Installed= 1520;     { additional diskette drive not installed }
  msg_SysInit_Too_Many_PARMS    = 1521;     { Too many parms on line }
  msg_SysInit_DSKT_Installed_AS = 1522;     { diskette drive installed as letter %1 }
  msg_SysInit_MISSING_SYMB      = 1523;     { No equal or space }
  { 1708 not used }
  msg_SysInit_START_No_LOAD     = 1709;     { startup not loaded }
  msg_SysInit_START_No_INIT     = 1710;     { startup no initialize }
  { 1711 - 1717 not used }
  msg_SysInit_UFILE_Not_FND     = 1718;     { User file not found }
  msg_SysInit_UDRVR_INVAL       = 1719;     { User device driver invalid }
  msg_SysInit_FSD_Not_VAL       = 1720;     { data to ipl incorrect }
  msg_SysInit_BANNER            = 1721;     { Version banner message }
  msg_SysInit_CANT_LOAD_MOD     = 1722;     { Can't load module }
  msg_SysInit_EPT_MISSING       = 1723;     { Entry point missing }
  msg_SysInit_CANT_Open_CON     = 1724;     { Can't open con }
  msg_SysInit_WRONG_Handle      = 1725;     { wrong handle for standard input file }
  msg_SysInit_PRESS_ENTER       = 1726;     { Press enter to continue }
  msg_SysInit_CANT_GET_Cache    = 1727;     { Can't allocate cache memory }
  msg_SysInit_CANT_INIT_Cache   = 1728;     { not enough memory for diskcache }
  msg_SysInit_Vio_Cp            = 1729;     { VioSetCp failed }
  msg_SysInit_Kbd_Cp            = 1730;     { KbdSetCp failed }
  { 1731 - 1732 not used }
  msg_SysInit_SCFILE_INVAL      = 1733;     { System country file is bad }
  { 1734 not used }
  msg_SysInit_Cp_ASSUME         = 1735;     { Assumed codepage }
  { 1736 not used }
  msg_SysInit_Cp_FATAL          = 1737;     { Codepage switching disabled }
  msg_SysInit_Not_INIT_NMI      = 1738;     { cannot initial NMI ALSO FOR MODE MGR }

  msg_VLPT_No_SPOOL             = 1797;     { could not access spool file }
  msg_VCOM_Device_In_USE        = 1798;     { COM port in use }
  msg_VLPT_Device_Busy          = 1799;     { parallel port in use }

  { 1901 - 1914 utilmid2 }
  msg_ASYNC_Bad_ARBT            = 1903;     { COM02 bad arbit level }
  msg_INTERNAL_Error            = 1915;     { Internal error in the Kernel }
  msg_User_Error                = 1916;     { user error }
  msg_SysInit_UEXEC_FAIL        = 1919;     { User program won't execute }
  { 1920 - 1923 not used }
  msg_PAGE_Fault                = 1923;     { page fault trap }
  msg_INTERRUPTS_DISABLED       = 1924;     { system called with interrupts }
  msg_SysInit_SEXEC_FAIL        = 1925;     { System program won't execute }
  msg_GEN_Prot_Fault            = 1926;     { General protect fault trap d }
  msg_Change_INT_VECTOR         = 1927;     { real mode changed interrupt vector }
  msg_NoMEM_FOR_RELOAD          = 1928;     { no storage to reload code or segment }
  msg_STACK_OVERFLOW            = 1929;     { argument stack low }
  msg_Trap0                     = 1930;     { divide error }
  msg_Trap1                     = 1931;     { single step trap }
  msg_Trap2                     = 1932;     { hardware memory error }
  msg_Trap3                     = 1933;     { breakpoint instruction }
  msg_Trap4                     = 1934;     { computation overflow }
  msg_Trap5                     = 1935;     { index out of range }
  msg_Trap6                     = 1936;     { incorrect instruction }
  msg_Trap7                     = 1937;     { cannot process instruction }
  msg_Trap8                     = 1938;     { double exception error }
  msg_Trap9                     = 1939;     { math coprocessor }
  msg_TrapA                     = 1940;     { task state segment }
  msg_TrapB                     = 1941;     { segment not in memory }
  msg_TrapC                     = 1942;     { memory beyond the stack segment }
  msg_TrapD                     = 1943;     { bad segment value }
  msg_NMI                       = 1944;     { nonmaskable interrupt }
  msg_NMI_EXC1                  = 1945;     { error with memory system board }
  msg_NM12_EXC2                 = 1946;     { error memory cards }
  msg_NMI2_EXC3                 = 1947;     { timeout on dma }
  msg_NMI2_EXC4                 = 1948;     { timeout by watchdog timer }
  msg_TrapE                     = 1949;     { bad linear address }
  msg_NPXIEMSG                  = 1950;     { incorrect operation }
  msg_NPXDEMSG                  = 1951;     { denormalized operand }
  msg_NPXZEMSG                  = 1952;     { zero divide }
  msg_NPXOEMSG                  = 1953;     { overflow }
  msg_NPXUEMSG                  = 1954;     { underflow }
  msg_NPXPEMSG                  = 1955;     { precision }
  msg_NPXINSTEMSG               = 1956;     { error occurred at address }
  msg_NPXBADSW                  = 1957;     { bad coprocess.status Word }
  msg_PAGEMGR_Trap02_Mem_REC    = 1958;     { mem parity error phys loc }
  msg_PAGEMGR_Trap02_APP_TERM   = 1959;     { mem parity error phys loc }
  msg_SysInit_BOOT_Error        = 2025;     { boot error }
  msg_SysInit_BIO_Not_FD        = 2026;     { COMMAND.COM not found }
  msg_SysInit_INSER_DK          = 2027;     { Insert diskette }
  msg_SysInit_DOS_Not_FD        = 2028;     { IBMDOS.COM not found }
  msg_SysInit_DOS_Not_VAL       = 2029;     { IBMDOS.COM not valid }
  msg_SysInit_More_MEM          = 2030;     { need more memory }
  { 2031 - 2056 utilmid3 }
  { 2057 - 2062 not used }
  msg_SysInit_DOS_Too_BIG       = 2063;     { not enough memory for PC DOS mode }
  msg_SysInit_DOS_No_MEM        = 2064;     { Out of memory starting DOS mode }
  msg_SysInit_Sys_STOPPED       = 2065;     { System is stopped }
  msg_SysInit_DOS_STOPPED       = 2066;     { DOS mode not started }
  msg_SysInit_SDRVR_INVAL       = 2067;     { System device driver invalid }
  msg_SysInit_MSG_LOST          = 2068;     { Messages lost }
  msg_SysInit_UCFILE_INVAL      = 2069;     { User country file is bad }
  msg_DEMAND_LOAD_Failed        = 2070;     { the demand load has failed }

  { Messages for CDROM, messages 3100-3125 }
  msg_CDFS_Bad_OS_VERSION       = 3100;
  msg_CDFS_DEB_STAT_SIGNON      = 3101;
  msg_CDFS_DEB_SIGNON           = 3102;
  msg_CDFS_STAT_SIGNON          = 3103;
  msg_CDFS_SIGNON               = 3104;
  msg_CDFS_Unknown_Err_CODE     = 3105;
  msg_CDFS_Bad_PARM             = 3106;
  msg_CDFS_MIN_SectorS          = 3107;
  msg_CDFS_DEBUG                = 3108;
  msg_CDFS_MAX_SectorS          = 3109;
  msg_CDFS_MIN_File_SECT        = 3110;
  msg_CDFS_MAX_File_SECT        = 3111;
  msg_CDFS_PRIMARY_VD           = 3112;
  msg_CDFS_SECONDARY_VD         = 3113;
  msg_CDFS_Sector_Cache         = 3114;
  msg_CDFS_SectorS_READ         = 3115;
  msg_CDFS_INIT_FAIL            = 3116;
  msg_CDFS_Mem_INIT_FAIL        = 3117;
  msg_CDFS_PARTIAL_Mem_FAIL     = 3118;
  msg_CDFS_No_INFOSEG           = 3119;

  { Display driver errors }
  msg_SysInit_DISPLAY_MISMATCH  = 3135;     { display.dll invalid with current hardware }

  { EISA NMI messages. }
  msg_EISA_NMI_SOFTWARE         = 3140;
  msg_EISA_NMI_BUS              = 3141;
  msg_EISA_NMI_FAILSAFE         = 3142;
  msg_EISA_NMI_IOCHK            = 3143;
  msg_EISA_NMI_PARITY           = 3144;

  msg_Bad_Command_COM           = 3145;
  msg_SysInit_LDR_MSG_Not_FD    = 3146;
  msg_SysInit_LDR_MSG_Not_VAL   = 3147;

  msg_Not_80386_CpU             = 3161;     { can't boot on 8086/286 }
  msg_80_STEPPING               = 3162;     { can't boot on a 386 BO }
  msg_32BIT_MULTIPLY            = 3163;     { 386 with bad 32 bit multiply }

  { Exception HardErr Popup messages. }
  msg_Xcpt_User                 = 3170;     { Fatal user exception. }
  msg_Xcpt_STACK_OVERRUN        = 3171;     { Stack overrun dispatching exception }
  msg_Xcpt_Cannot_DISPATCH      = 3172;     { Fatal error dispatching exception }
  msg_Xcpt_BREAKPOINT           = 3173;
  msg_Xcpt_SINGLE_STEP          = 3174;
  msg_Xcpt_Access_Violation     = 3175;
  msg_Xcpt_ILLEGAL_INSTRUCTION  = 3176;
  msg_Xcpt_FLOAT_DENORMAL_OPERAND = 3177;
  msg_Xcpt_FLOAT_DIVIDE_BY_Zero = 3178;
  msg_Xcpt_FLOAT_INEXACT_RESULT = 3179;
  msg_Xcpt_FLOAT_Invalid_OPERATIO = 3180;
  msg_Xcpt_FLOAT_OVERFLOW       = 3181;
  msg_Xcpt_FLOAT_STACK_CHECK    = 3182;
  msg_Xcpt_FLOAT_UNDERFLOW      = 3183;
  msg_Xcpt_INTEGER_DIVIDE_BY_Zero = 3184;
  msg_Xcpt_INTEGER_OVERFLOW     = 3185;
  msg_Xcpt_PRIVILEGED_INSTRUCTION = 3186;
  msg_Xcpt_In_PAGE_Error        = 3187;
  msg_Xcpt_NoNCONTINUABLE_EXCEPTI = 3188;
  msg_Xcpt_Invalid_DISPOSITION  = 3189;
  msg_Xcpt_Invalid_LOCK_SEQUENCE= 3190;
  msg_Xcpt_ARRAY_BOUNDS_ExceedED= 3191;
  msg_Xcpt_B1NPX_ERRATA_02      = 3192;

  { FAT to HPFS conversion (FATBALL) messages }

  msg_HardWARE_CONFIGURATION    = 3332;


{ Error codes for Base OS/2 applications }

const
  no_Error                      = 0;    { No error occurred             }
  error_Invalid_Function        = 1;    { Invalid function number       }
  error_File_Not_Found          = 2;    { File not found                }
  error_Path_Not_Found          = 3;    { Path not found                }
  error_Too_Many_Open_Files     = 4;    { Too many open files (no handles left)}
  error_Access_Denied           = 5;    { Access denied                 }
  error_Invalid_Handle          = 6;    { Invalid handle                }
  error_Arena_Trashed           = 7;    { Memory control blocks destroyed }
  error_Not_Enough_Memory       = 8;    { Insufficient memory           }
  error_Invalid_Block           = 9;    { Invalid memory-block address  }
  error_Bad_Environment         = 10;   { Invalid environment           }
  error_Bad_Format              = 11;   { Invalid format                }
  error_Invalid_Access          = 12;   { Invalid access code           }
  error_Invalid_Data            = 13;   { Invalid data                  }
  error_Invalid_Drive           = 15;   { Invalid drive specified       }
  error_Current_Directory       = 16;   { Attempting to remove current directory }
  error_Not_Same_Device         = 17;   { Not same device               }
  error_No_More_Files           = 18;   { No more files                 }
  error_Write_Protect           = 19;   { Attempt to write on write-protected diskette }
  error_Bad_Unit                = 20;   { Unknown unit                  }
  error_Not_Ready               = 21;   { Drive not ready               }
  error_Bad_Command             = 22;   { Unknown command               }
  error_Crc                     = 23;   { Data error - cyclic redundancy check }
  error_Bad_Length              = 24;   { Invalid request structure length }
  error_Seek                    = 25;   { Seek error                    }
  error_Not_Dos_Disk            = 26;   { Unknown media type            }
  error_Sector_Not_Found        = 27;   { Sector not found              }
  error_Out_Of_Paper            = 28;   { Printer is out of paper       }
  error_Write_Fault             = 29;   { FAULT Write fault             }
  error_Read_Fault              = 30;   { Read fault                    }
  error_Gen_Failure             = 31;   { General failure               }
  error_Sharing_Violation       = 32;   { Sharing violation             }
  error_Lock_Violation          = 33;   { Lock violation                }
  error_Wrong_Disk              = 34;   { Invalid disk change           }
  error_Fcb_Unavailable         = 35;   { FCB unavailable               }
  error_Sharing_Buffer_Exceeded = 36;   { Sharing buffer overflow       }
  error_Code_Page_Mismatched    = 37;   { Code page does not match      }
  error_Handle_Eof              = 38;   { End of file reached           }
  error_Handle_Disk_Full        = 39;   { Disk is full                  }
  error_Not_Supported           = 50;   { Network request not supported }
  error_Rem_Not_List            = 51;   { Remote network node is not online }
  error_Dup_Name                = 52;   { Duplicate file name in network }
  error_Bad_Netpath             = 53;   { Network path not found        }
  error_Network_Busy            = 54;   { Network is busy               }
  error_Dev_Not_Exist           = 55;   { Device is not installed in network }
  error_Too_Many_Cmds           = 56;   { Network command limit reached }
  error_Adap_Hdw_Err            = 57;   { Network adapter hardware error }
  error_Bad_Net_Resp            = 58;   { Incorrect response in network }
  error_Unexp_Net_Err           = 59;   { Unexpected error in network   }
  error_Bad_Rem_Adap            = 60;   { Remote network adapter error  }
  error_Printq_Full             = 61;   { Network printer queue is full }
  error_No_Spool_Space          = 62;   { No space in print spool file  }
  error_Print_Cancelled         = 63;   { Print spool file deleted      }
  error_Netname_Deleted         = 64;   { Network name deleted          }
  error_Network_Access_Denied   = 65;   { Access to network denied      }
  error_Bad_Dev_Type            = 66;   { Device type invalid for network }
  error_Bad_Net_Name            = 67;   { Network name not found        }
  error_Too_Many_Names          = 68;   { Network name limit exceeded   }
  error_Too_Many_Sess           = 69;   { Network session limit exceeded }
  error_Sharing_Paused          = 70;   { Temporary pause in network    }
  error_Req_Not_Accep           = 71;   { Network request denied        }
  error_Redir_Paused            = 72;   { Pause in network print disk redirection }
  error_Sbcs_Att_Write_Prot     = 73;   { Attempted write on protected disk }
  error_Sbcs_General_Failure    = 74;   { General failure, single-byte character set }
  error_Xga_Out_Memory          = 75;
  error_File_Exists             = 80;   { File exists                   }
  error_Dup_Fcb                 = 81;   { Reserved                      }
  error_Cannot_Make             = 82;   { Cannot make directory entry   }
  error_Fail_I24                = 83;   { Failure on INT 24             }
  error_Out_Of_Structures       = 84;   { Too many redirections         }
  error_Already_Assigned        = 85;   { Duplicate redirection         }
  error_Invalid_PassWord        = 86;   { Invalid passWord              }
  error_Invalid_Parameter       = 87;   { Invalid parameter             }
  error_Net_Write_Fault         = 88;   { Network device fault          }
  error_No_Proc_Slots           = 89;   { No process slots available    }
  error_Not_Frozen              = 90;   { System error                  }
  err_Tstovfl                   = 91;   { Timer service table overflow  }
  err_Tstdup                    = 92;   { Timer service table duplicate }
  error_No_Items                = 93;   { No items to work on           }
  error_Interrupt               = 95;   { Interrupted system call       }
  error_Device_In_Use           = 99;   { Device in use                 }
  error_Too_Many_Semaphores     = 100;  { User/system open semaphore limit reached }
  error_Excl_Sem_Already_Owned  = 101;  { Exclusive semaphore already owned }
  error_Sem_Is_Set              = 102;  { DosCloseSem found semaphore set }
  error_Too_Many_Sem_Requests   = 103;  { Too many exclusive semaphore requests }
  error_Invalid_At_Interrupt_Time = 104; { Operation invalid at interrupt time }
  error_Sem_Owner_Died          = 105;  { Previous semaphore owner terminated without freeing semaphore }
  error_Sem_User_Limit          = 106;  { Semaphore limit exceeded      }
  error_Disk_Change             = 107;  { Insert drive B disk into drive A }
  error_Drive_Locked            = 108;  { Drive locked by another process }
  error_Broken_Pipe             = 109;  { Write on pipe with no reader }
  error_Open_Failed             = 110;  { Open/create failed due to explicit fail command }
  error_Buffer_Overflow         = 111;  { Buffer passed to system call too small to hold return data }
  error_Disk_Full               = 112;  { Not enough space on the disk }
  error_No_More_Search_Handles  = 113;  { Cannot allocate another search structure and handle }
  error_Invalid_Target_Handle   = 114;  { Target handle in DosDupHandle invalid }
  error_Protection_Violation    = 115;  { Invalid user virtual address }
  error_Viokbd_Request          = 116;  { Error on display write or keyboard read }
  error_Invalid_Category        = 117;  { Category for DevIOCtl not defined }
  error_Invalid_Verify_Switch   = 118;  { Invalid value passed for verify flag }
  error_Bad_Driver_Level        = 119;  { Level four driver not found   }
  error_Call_Not_Implemented    = 120;  { Invalid function called       }
  error_Sem_Timeout             = 121;  { Time-out occurred from semaphore API function }
  error_Insufficient_Buffer     = 122;  { Data buffer too small         }
  error_Invalid_Name            = 123;  { Illegal character or invalid file-system name }
  error_Invalid_Level           = 124;  { Non-implemented level for information retrieval or setting }
  error_No_Volume_Label         = 125;  { No volume label found with DosQueryFSInfo function }
  error_Mod_Not_Found           = 126;  { Module handle not found with DosQueryProcAddr, DosQueryModAddr }
  error_Proc_Not_Found          = 127;  { Procedure address not found with DosQueryProcAddr }
  error_Wait_No_Children        = 128;  { DosWaitChild finds no children }
  error_Child_Not_Complete      = 129;  { DosWaitChild children not terminated }
  error_Direct_Access_Handle    = 130;  { Handle operation invalid for direct disk-access handles }
  error_Negative_Seek           = 131;  { Attempting seek to negative offset }
  error_Seek_On_Device          = 132;  { Application trying to seek on device or pipe }
  error_Is_Join_Target          = 133;  { Drive has previously joined drives }
  error_Is_Joined               = 134;  { Drive is already joined }
  error_Is_Substed              = 135;  { Drive is already substituted }
  error_Not_Joined              = 136;  { Cannot delete drive that is not joined }
  error_Not_Substed             = 137;  { Cannot delete drive that is not substituted }
  error_Join_To_Join            = 138;  { Cannot join to a joined drive }
  error_Subst_To_Subst          = 139;  { Cannot substitute to a substituted drive }
  error_Join_To_Subst           = 140;  { Cannot join to a substituted drive }
  error_Subst_To_Join           = 141;  { Cannot substitute to a joined drive }
  error_Busy_Drive              = 142;  { Specified drive is busy }
  error_Same_Drive              = 143;  { Cannot join or substitute a drive to a directory on the same drive }
  error_Dir_Not_Root            = 144;  { Directory must be a subdirectory of the root }
  error_Dir_Not_Empty           = 145;  { Directory must be empty to use join command }
  error_Is_Subst_Path           = 146;  { Path specified is being used in a substitute }
  error_Is_Join_Path            = 147;  { Path specified is being used in a join }
  error_Path_Busy               = 148;  { Path specified is being used by another process }
  error_Is_Subst_Target         = 149;  { Cannot join or substitute a drive that
                                          has a directory that is the target of
                                          a previous substitute         }
  error_System_Trace            = 150;  { System trace error            }
  error_Invalid_Event_Count     = 151;  { DosWaitMuxWaitSem errors      }
  error_Too_Many_Muxwaiters     = 152;  { System limit of 100 entries reached }
  error_Invalid_List_Format     = 153;  { Invalid list format           }
  error_Label_Too_Long          = 154;  { Volume label too big          }
  error_Too_Many_Tcbs           = 155;  { Cannot create another TCB     }
  error_Signal_Refused          = 156;  { Signal refused                }
  error_Discarded               = 157;  { Segment is discarded          }
  error_Not_Locked              = 158;  { Segment is not locked         }
  error_Bad_Threadid_Addr       = 159;  { Invalid thread-identity address }
  error_Bad_Arguments           = 160;  { Invalid environment pointer   }
  error_Bad_Pathname            = 161;  { Invalid path name passed to exec }
  error_Signal_Pending          = 162;  { Signal already pending        }
  error_Uncertain_Media         = 163;  { Error with INT 24 mapping     }
  error_Max_Thrds_Reached       = 164;  { No more process slots         }
  error_Monitors_Not_Supported  = 165;  { Error with INT 24 mapping     }
  error_Unc_Driver_Not_Installed        = 166;  { Default redirection return code }
  error_Lock_Failed             = 167;  { Locking failed                }
  error_Swapio_Failed           = 168;  { Swap I/O failed               }
  error_Swapin_Failed           = 169;  { Swap in failed                }
  error_Busy                    = 170;  { Segment is busy               }
  error_Cancel_Violation        = 173;  { A lock request is not outstanding
                                          for the specified file range, or the
                                          range length is zero }
  error_Atomic_Lock_Not_Supported       = 174;  { The file-system driver (FSD)
                                          does not support atomic lock operations.
                                          Versions of OS/2 prior to Version 2.00
                                          do not support atomic lock operations }
  error_Read_Locks_Not_Supported        = 175;  { The file system driver (FSD)
                                          does not support shared read locks }
  error_Invalid_Segment_Number  = 180;  { Invalid segment number        }
  error_Invalid_Callgate        = 181;  { Invalid call gate             }
  error_Invalid_Ordinal         = 182;  { Invalid ordinal               }
  error_Already_Exists          = 183;  { Shared segment already exists }
  error_No_Child_Process        = 184;  { No child process to wait for  }
  error_Child_Alive_Nowait      = 185;  { NoWait specified and child alive }
  error_Invalid_Flag_Number     = 186;  { Invalid flag number           }
  error_Sem_Not_Found           = 187;  { Semaphore does not exist      }
  error_Invalid_Starting_Codeseg = 188; { Invalid starting code segment, incorrect END (label) directive }
  error_Invalid_Stackseg        = 189;  { Invalid stack segment         }
  error_Invalid_Moduletype      = 190;  { Invalid module type - dynamic-link
                                          library file cannot be used as an
                                          application. Application cannot be
                                          used as a dynamic-link library }
  error_Invalid_Exe_Signature   = 191;  { Invalid EXE signature - file is
                                          a DOS mode program or an improper
                                          program }
  error_Exe_Marked_Invalid      = 192;  { EXE marked invalid - link detected
                                          errors when the application was created }
  error_Bad_Exe_Format          = 193;  { Invalid EXE format - file is a DOS mode
                                          program or an improper program }
  error_Iterated_Data_Exceeds_64k = 194; { Iterated data exceeds 64KB -
                                          there is more than 64KB of data in
                                          one of the segments of the file }
  error_Invalid_Minallocsize    = 195;  { Invalid minimum allocation size -
                                          the size is specified to be less
                                          than the size of the segment data
                                          in the file }
  error_Dynlink_From_Invalid_Ring = 196; { Dynamic link from invalid privilege
                                          level - privilege level 2 routine cannot
                                          link to dynamic-link libraries }
  error_Iopl_Not_Enabled        = 197;  { IOPL not enabled - IOPL set to NO in CONFIG SYS }
  error_Invalid_Segdpl          = 198;  { Invalid segment descriptor privilege
                                          level - can only have privilege levels
                                          of 2 and 3 }
  error_Autodataseg_Exceeds_64k = 199;  { Automatic data segment exceeds 64KB   }
  error_Ring2seg_Must_Be_Movable = 200; { Privilege level 2 segment must be movable }
  error_Reloc_Chain_Xeeds_Seglim = 201; { Relocation chain exceeds segment limit }
  error_Infloop_In_Reloc_Chain  = 202;  { Infinite loop in relocation chain segment }
  error_Envvar_Not_Found        = 203;  { Environment variable not found }
  error_Not_Current_Ctry        = 204;  { Not current country }
  error_No_Signal_Sent          = 205;  { No signal sent - no process in the command
                                          subtree has a signal handler }
  error_Filename_Exced_Range    = 206;  { File name or extension is greater than 8 3 characters }
  error_Ring2_Stack_In_Use      = 207;  { Privilege level 2 stack is in use }
  error_Meta_Expansion_Too_Long = 208;  { Meta (global) expansion is too long }
  error_Invalid_Signal_Number   = 209;  { Invalid signal number         }
  error_Thread_1_Inactive       = 210;  { Inactive thread               }
  error_Info_Not_Avail          = 211;  { File system information is not available for this file }
  error_Locked                  = 212;  { Locked error                  }
  error_Bad_Dynalink            = 213;  { Attempted to execute a non-family API in DOS mode }
  error_Too_Many_Modules        = 214;  { Too many modules              }
  error_Nesting_Not_Allowed     = 215;  { Nesting is not allowed        }
  error_Cannot_Shrink           = 216;  { The ring 2 stack is not allowed to shrink }
  error_Zombie_Process          = 217;  { Zombie process                }
  error_Stack_In_High_Memory    = 218;  { Stack is in high memory       }
  error_Invalid_Exitroutine_Ring = 219; { Invalid exit routine ring     }
  error_GetBuf_Failed           = 220;  { Get buffer failed             }
  error_FlushBuf_Failed         = 221;  { Flush buffer failed           }
  error_Transfer_Too_Long       = 222;  { Transfer is too long          }
  error_ForceNoSwap_Failed      = 223;
  error_Smg_No_Target_Window    = 224;  { The application window was created
                                          without the fcf_TaskList style, or the
                                          application window not yet been created
                                          or has already been destroyed }
  error_No_Children             = 228;  { No child process              }
  error_Invalid_Screen_Group    = 229;  { Invalid session               }
  error_Bad_Pipe                = 230;  { Non-existent pipe or invalid operation }
  error_Pipe_Busy               = 231;  { Pipe is busy                  }
  error_No_Data                 = 232;  { No data available on non-blocking read }
  error_Pipe_Not_Connected      = 233;  { Pipe was disconnected by server }
  error_More_Data               = 234;  { More data is available        }
  error_Vc_Disconnected         = 240;  { Session was dropped due to errors }
  error_Circularity_Requested   = 250;  { Renaming a directory that would cause a circularity problem }
  error_Directory_In_Cds        = 251;  { Renaming a directory that is in use }
  error_Invalid_Fsd_Name        = 252;  { Trying to access nonexistent FSD }
  error_Invalid_Path            = 253;  { Invalid pseudo device         }
  error_Invalid_Ea_Name         = 254;  { Invalid character in name, or invalid cbName }
  error_Ea_List_Inconsistent    = 255;  { List does not match its size, or there are invalid EAs in the list }
  error_Ea_List_Too_Long        = 256;  { FEAList is longer than 64K-1 bytes }
  error_No_Meta_Match           = 257;  { String does not match expression }
  error_FindNotify_Timeout      = 258;  { A timeout occured before the requested changes could be completed }
  error_No_More_Items           = 259;  { DosQueryFSAttach ordinal query }
  error_Search_Struc_Reused     = 260;  { DOS mode findfirst/next search structure reused }
  error_Char_Not_Found          = 261;  { Character not found           }
  error_Too_Much_Stack          = 262;  { Stack request exceeds system limit }
  error_Invalid_Attr            = 263;  { Invalid attribute             }
  error_Invalid_Starting_Ring   = 264;  { Invalid starting ring         }
  error_Invalid_Dll_Init_Ring   = 265;  { Invalid DLL INIT ring         }
  error_Cannot_Copy             = 266;  { Cannot copy                   }
  error_Directory               = 267;  { Used by DOSCOPY in doscall1   }
  error_Oplocked_File           = 268;  { Oplocked file                 }
  error_Oplock_Thread_Exists    = 269;  { Oplock thread exists          }
  error_Volume_Changed          = 270;  { Volume changed                }
  error_FindNotify_Handle_In_Use = 271;
  error_FindNotify_Handle_Closed = 272;
  error_Notify_Object_Removed   = 273;
  error_Already_Shutdown        = 274;  { System is already shut down   }
  error_Eas_Didnt_Fit           = 275;  { Buffer is not big enough to hold the EAs }
  error_Ea_File_Corrupt         = 276;  { EA file has been damaged      }
  error_Ea_Table_Full           = 277;  { EA table is full              }
  error_Invalid_Ea_Handle       = 278;  { EA handle is invalid          }
  error_No_Cluster              = 279;  { No cluster                    }
  error_Create_Ea_File          = 280;  { Cannot create the EA file     }
  error_Cannot_Open_Ea_File     = 281;  { Cannot open the EA file       }
  error_Eas_Not_Supported       = 282;  { Destination file system does not support EAs }
  error_Need_Eas_Found          = 283;  { Destination file system does not support EAs,
                                          and the source file's EAs contain a need EA }
  error_Duplicate_Handle        = 284;  { The handle already exists     }
  error_Duplicate_Name          = 285;  { The name already exists       }
  error_Empty_Muxwait           = 286;  { The list of semaphores in a muxwait semaphore is empty }
  error_Mutex_Owned             = 287;  { The calling thread owns one or more of the mutex semaphores in the list }
  error_Not_Owner               = 288;  { Caller does not own the semaphore }
  error_Param_Too_Small         = 289;  { Parameter is not large enough to
                                          contain all of the semaphore records
                                          in the muxwait semaphore }
  error_Too_Many_Handles        = 290;  { Limit reached for number of handles }
  error_Too_Many_Opens          = 291;  { There are too many files or semaphores open }
  error_Wrong_Type              = 292;  { Attempted to create wrong type of semaphore }
  error_Unused_Code             = 293;  { Code is not used              }
  error_Thread_Not_Terminated   = 294;  { Thread has not terminated     }
  error_Init_Routine_Failed     = 295;  { Initialization routine failed }
  error_Module_In_Use           = 296;  { Module is in use              }
  error_Not_Enough_Watchpoints  = 297;  { There are not enough watchpoints }
  error_Too_Many_Posts          = 298;  { Post count limit was reached for an event semaphore }
  error_Already_Posted          = 299;  { Event semaphore is already posted }
  error_Already_Reset           = 300;  { Event semaphore is already reset }
  error_Sem_Busy                = 301;  { Semaphore is busy             }

{ end of set 0 - 302 }

  error_User_Defined_Base       = $FF00;

  error_I24_Write_Protect       = 0;
  error_I24_Bad_Unit            = 1;
  error_I24_Not_Ready           = 2;
  error_I24_Bad_Command         = 3;
  error_I24_Crc                 = 4;
  error_I24_Bad_Length          = 5;
  error_I24_Seek                = 6;
  error_I24_Not_Dos_Disk        = 7;
  error_I24_Sector_Not_Found    = 8;
  error_I24_Out_Of_Paper        = 9;
  error_I24_Write_Fault         = 10;
  error_I24_Read_Fault          = 11;
  error_I24_Gen_Failure         = 12;
  error_I24_Disk_Change         = 13;
  error_I24_Wrong_Disk          = 15;
  error_I24_Uncertain_Media     = 16;
  error_I24_Char_Call_Interrupted = 17;
  error_I24_No_Monitor_Support  = 18;
  error_I24_Invalid_Parameter   = 19;
  error_I24_Device_In_Use       = 20;
  error_I24_Quiet_Init_Fail     = 21;

  allowed_Fail                  = $0001;
  allowed_Abort                 = $0002;
  allowed_Retry                 = $0004;
  allowed_Ignore                = $0008;
  allowed_Acknowledge           = $0010;
  allowed_Dispatch              = $8000;
  allowed_Regdump               = $0020;
  allowed_Detached              = allowed_Dispatch;
  allowed_Reserved              = not (allowed_Fail or allowed_Abort or
    allowed_Retry or allowed_Ignore or allowed_Acknowledge);

  i24_Operation                 = $01;
  i24_Area                      = $06;
  i24_Class                     = $80;

{ Values for error CLASS }
  errclass_Outres               = 1;    { Out of Resource               }
  errclass_Tempsit              = 2;    { Temporary Situation           }
  errclass_Auth                 = 3;    { Permission problem            }
  errclass_Intrn                = 4;    { Internal System Error         }
  errclass_Hrdfail              = 5;    { Hardware Failure              }
  errclass_Sysfail              = 6;    { System Failure                }
  errclass_Apperr               = 7;    { Application Error             }
  errclass_Notfnd               = 8;    { Not Found                     }
  errclass_Badfmt               = 9;    { Bad Format                    }
  errclass_Locked               = 10;   { Locked                        }
  errclass_Media                = 11;   { Media Failure                 }
  errclass_Already              = 12;   { Collision with Existing Item  }
  errclass_Unk                  = 13;   { Unknown/other                 }
  errclass_Cant                 = 14;
  errclass_Time                 = 15;

{ Values for error ACTION }
  erract_Retry                  = 1;    { Retry                          }
  erract_Dlyret                 = 2;    { Delay Retry, retry after pause }
  erract_User                   = 3;    { Ask user to regive information }
  erract_Abort                  = 4;    { abort with clean up            }
  erract_Panic                  = 5;    { abort immediately              }
  erract_Ignore                 = 6;    { ignore                         }
  erract_Intret                 = 7;    { Retry after User Intervention  }

{ Values for error LOCUS }
  errloc_Unk                    = 1;    { No appropriate value           }
  errloc_Disk                   = 2;    { Random Access Mass Storage     }
  errloc_Net                    = 3;    { Network                        }
  errloc_Serdev                 = 4;    { Serial Device                  }
  errloc_Mem                    = 5;    { Memory                         }

{ Abnormal termination codes }
  tc_Normal                     = 0;
  tc_Harderr                    = 1;
  tc_Gp_Trap                    = 2;
  tc_Signal                     = 3;
  tc_Xcpt                       = 4;

  error_Invalid_Procid          = 303;  { Invalid process identity      }
  error_Invalid_Pdelta          = 304;  { Invalid priority delta        }
  error_Not_Descendant          = 305;  { Not descendant                }
  error_Not_Session_Manager     = 306;  { Requestor not session manager }
  error_Invalid_Pclass          = 307;  { Invalid P class               }
  error_Invalid_Scope           = 308;  { Invalid scope                 }
  error_Invalid_Threadid        = 309;  { Invalid thread identity       }
  error_Dossub_Shrink           = 310;  { Cannot shrink segment - DosSubSetMem }
  error_Dossub_Nomem            = 311;  { No memory to satisfy request - DosSubAllocMem }
  error_Dossub_Overlap          = 312;  { Overlap of the specified block with a
                                          block of allocated memory - DosSubFreeMem }
  error_Dossub_Badsize          = 313;  { Invalid size parameter - DosSubAllocMem or DosSubFreeMem }
  error_Dossub_Badflag          = 314;  { Invalid flag parameter - DosSubSetMem }
  error_Dossub_Badselector      = 315;  { Invalid segment selector      }
  error_Mr_Msg_Too_Long         = 316;  { Message too long for buffer   }
  mgs_Mr_Msg_Too_Long           = 316;  { The message passed to the message retriever was truncated }
  error_Mr_Mid_Not_Found        = 317;  { Message identity number not found }
  error_Mr_Un_Acc_Msgf          = 318;  { Unable to access message file }
  error_Mr_Inv_Msgf_Format      = 319;  { Invalid message file format   }
  error_Mr_Inv_Ivcount          = 320;  { Invalid insertion variable count }
  error_Mr_Un_Perform           = 321;  { Unable to perform function    }
  error_Ts_Wakeup               = 322;  { Unable to wake up             }
  error_Ts_Semhandle            = 323;  { Invalid system semaphore      }
  error_Ts_Notimer              = 324;  { No timers available           }
  error_Ts_Handle               = 326;  { Invalid timer handle          }
  error_Ts_Datetime             = 327;  { Date or time invalid          }
  error_Sys_Internal            = 328;  { Internal system error         }
  error_Que_Current_Name        = 329;  { Current queue name does not exist }
  error_Que_Proc_Not_Owned      = 330;  { Current process does not own queue }
  error_Que_Proc_Owned          = 331;  { Current process owns queue    }
  error_Que_Duplicate           = 332;  { Duplicate queue name          }
  error_Que_Element_Not_Exist   = 333;  { Queue element does not exist  }
  error_Que_No_Memory           = 334;  { Inadequate queue memory       }
  error_Que_Invalid_Name        = 335;  { Invalid queue name            }
  error_Que_Invalid_Priority    = 336;  { Invalid queue priority parameter }
  error_Que_Invalid_Handle      = 337;  { Invalid queue handle          }
  error_Que_Link_Not_Found      = 338;  { Queue link not found          }
  error_Que_Memory_Error        = 339;  { Queue memory error            }
  error_Que_Prev_At_End         = 340;  { Previous queue element was at end of queue }
  error_Que_Proc_No_Access      = 341;  { Process does not have access to queues }
  error_Que_Empty               = 342;  { Queue is empty                }
  error_Que_Name_Not_Exist      = 343;  { Queue name does not exist     }
  error_Que_Not_Initialized     = 344;  { Queues not initialized        }
  error_Que_Unable_To_Access    = 345;  { Unable to access queues       }
  error_Que_Unable_To_Add       = 346;  { Unable to add new queue       }
  error_Que_Unable_To_Init      = 347;  { Unable to initialize queues   }
  error_Vio_Invalid_Mask        = 349;  { Invalid function replaced     }
  error_Vio_Ptr                 = 350;  { Invalid pointer to parameter  }
  error_Vio_Aptr                = 351;  { Invalid pointer to attribute  }
  error_Vio_Rptr                = 352;  { Invalid pointer to row        }
  error_Vio_Cptr                = 353;  { Invalid pointer to column     }
  error_Vio_Lptr                = 354;  { Invalid pointer to length     }
  error_Vio_Mode                = 355;  { Unsupported screen mode       }
  error_Vio_Width               = 356;  { Invalid cursor width value    }
  error_Vio_Attr                = 357;  { Invalid cursor attribute value }
  error_Vio_Row                 = 358;  { Invalid row value             }
  error_Vio_Col                 = 359;  { Invalid column value          }
  error_Vio_Toprow              = 360;  { Invalid TopRow value          }
  error_Vio_Botrow              = 361;  { Invalid BotRow value          }
  error_Vio_Rightcol            = 362;  { Invalid right column value    }
  error_Vio_Leftcol             = 363;  { Invalid left column value     }
  error_Scs_Call                = 364;  { Call issued by other than session manager }
  error_Scs_Value               = 365;  { Value is not for save or restore }
  error_Vio_Wait_Flag           = 366;  { Invalid wait flag setting     }
  error_Vio_Unlock              = 367;  { Screen not previously locked  }
  error_Sgs_Not_Session_Mgr     = 368;  { Caller not session manager    }
  error_Smg_Invalid_Sgid        = 369;  { Invalid session identity      }
  error_Smg_Invalid_Session_Id  = error_Smg_Invalid_Sgid; { Invalid session ID }
  error_Smg_Nosg                = 370;  { No sessions available         }
  error_Smg_No_Sessions         = 370;  { No sessions available         }
  error_Smg_Grp_Not_Found       = 371;  { Session not found             }
  error_Smg_Session_Not_Found   = error_Smg_Grp_Not_Found; { Session not found }
  error_Smg_Set_Title           = 372;  { Title sent by shell or parent cannot be changed }
  error_Kbd_Parameter           = 373;  { Invalid parameter to keyboard }
  error_Kbd_No_Device           = 374;  { No device                     }
  error_Kbd_Invalid_Iowait      = 375;  { Invalid I/O wait specified    }
  error_Kbd_Invalid_Length      = 376;  { Invalid length for keyboard   }
  error_Kbd_Invalid_Echo_Mask   = 377;  { Invalid echo mode mask        }
  error_Kbd_Invalid_Input_Mask  = 378;  { Invalid input mode mask       }
  error_Mon_Invalid_Parms       = 379;  { Invalid parameters to DosMon  }
  error_Mon_Invalid_Devname     = 380;  { Invalid device name string    }
  error_Mon_Invalid_Handle      = 381;  { Invalid device handle         }
  error_Mon_Buffer_Too_Small    = 382;  { Buffer too small              }
  error_Mon_Buffer_Empty        = 383;  { Buffer is empty               }
  error_Mon_Data_Too_Large      = 384;  { Data record is too large      }
  error_Mouse_No_Device         = 385;  { Mouse device closed (invalid device handle) }
  error_Mouse_Inv_Handle        = 386;  { Mouse device closed (invalid device handle) }
  error_Mouse_Inv_Parms         = 387;  { Parameters invalid for display mode }
  error_Mouse_Cant_Reset        = 388;  { Function assigned and cannot be reset }
  error_Mouse_Display_Parms     = 389;  { Parameters invalid for display mode }
  error_Mouse_Inv_Module        = 390;  { Module not valid              }
  error_Mouse_Inv_Entry_Pt      = 391;  { Entry point not valid         }
  error_Mouse_Inv_Mask          = 392;  { Function mask invalid         }
  NO_Error_Mouse_No_Data        = 393;  { No valid data                 }
  NO_Error_Mouse_Ptr_Drawn      = 394;  { Pointer drawn                 }
  error_Invalid_Frequency       = 395;  { Invalid frequency for beep    }
  error_Nls_No_Country_File     = 396;  { Cannot find COUNTRY SYS file  }
  error_Nls_Open_Failed         = 397;  { Cannot open COUNTRY SYS file  }
  error_Nls_No_Ctry_Code        = 398;  { Country code not found        }
  error_No_Country_Or_Codepage  = 398;  { Country code not found        }
  error_Nls_Table_Truncated     = 399;  { Table returned information truncated, buffer is too small }
  error_Nls_Bad_Type            = 400;  { Selected type does not exist  }
  error_Nls_Type_Not_Found      = 401;  { Selected type is not in file  }
  error_Vio_Smg_Only            = 402;  { Valid from session manager only }
  error_Vio_Invalid_Asciiz      = 403;  { Invalid ASCIIZ length         }
  error_Vio_Deregister          = 404;  { VioDeRegister not allowed     }
  error_Vio_No_Popup            = 405;  { Pop-up window not allocated   }
  error_Vio_Existing_Popup      = 406;  { Pop-up window on screen (NoWait) }
  error_Kbd_Smg_Only            = 407;  { Valid from session manager only }
  error_Kbd_Invalid_Asciiz      = 408;  { Invalid ASCIIZ length         }
  error_Kbd_Invalid_Mask        = 409;  { Invalid replacement mask      }
  error_Kbd_Register            = 410;  { KbdRegister not allowed       }
  error_Kbd_Deregister          = 411;  { KbdDeRegister not allowed     }
  error_Mouse_Smg_Only          = 412;  { Valid from session manager only }
  error_Mouse_Invalid_Asciiz    = 413;  { Invalid ASCIIZ length         }
  error_Mouse_Invalid_Mask      = 414;  { Invalid replacement mask      }
  error_Mouse_Register          = 415;  { Mouse register not allowed    }
  error_Mouse_Deregister        = 416;  { Mouse deregister not allowed  }
  error_Smg_Bad_Action          = 417;  { Invalid action specified      }
  error_Smg_Invalid_Call        = 418;  { INIT called more than once, or invalid session identity }
  error_Scs_Sg_Notfound         = 419;  { New session number            }
  error_Scs_Not_Shell           = 420;  { Caller is not shell           }
  error_Vio_Invalid_Parms       = 421;  { Invalid parameters passed     }
  error_Vio_Function_Owned      = 422;  { Save/restore already owned    }
  error_Vio_Return              = 423;  { Non-destruct return (undo)    }
  error_Scs_Invalid_Function    = 424;  { Caller invalid function       }
  error_Scs_Not_Session_Mgr     = 425;  { Caller not session manager    }
  error_Vio_Register            = 426;  { Vio register not allowed      }
  error_Vio_No_Mode_Thread      = 427;  { No mode restore thread in SG  }
  error_Vio_No_Save_Restore_Thd = 428;  { No save/restore thread in SG  }
  error_Vio_In_Bg               = 429;  { Function invalid in background }
  error_Vio_Illegal_During_Popup = 430; { Function not allowed during pop-up window }
  error_Smg_Not_Baseshell       = 431;  { Caller is not the base shell  }
  error_Smg_Bad_Statusreq       = 432;  { Invalid status requested      }
  error_Que_Invalid_Wait        = 433;  { NoWait parameter out of bounds }
  error_Vio_Lock                = 434;  { Error returned from Scroll Lock }
  error_Mouse_Invalid_Iowait    = 435;  { Invalid parameters for IOWait }
  error_Vio_Invalid_Handle      = 436;  { Invalid VIO handle            }
  error_Vio_Illegal_During_Lock = 437;  { Function not allowed during screen lock }
  error_Vio_Invalid_Length      = 438;  { Invalid VIO length            }
  error_Kbd_Invalid_Handle      = 439;  { Invalid KBD handle            }
  error_Kbd_No_More_Handle      = 440;  { Ran out of handles            }
  error_Kbd_Cannot_Create_Kcb   = 441;  { Unable to create kcb          }
  error_Kbd_Codepage_Load_Incompl = 442; { Unsuccessful code-page load  }
  error_Kbd_Invalid_Codepage_Id = 443;  { Invalid code-page identity    }
  error_Kbd_No_Codepage_Support = 444;  { No code page support          }
  error_Kbd_Focus_Required      = 445;  { Keyboard focus required       }
  error_Kbd_Focus_Already_Active = 446; { Calling thread has an outstanding focus }
  error_Kbd_Keyboard_Busy       = 447;  { Keyboard is busy              }
  error_Kbd_Invalid_Codepage    = 448;  { Invalid code page             }
  error_Kbd_Unable_To_Focus     = 449;  { Focus attempt failed          }
  error_Smg_Session_Non_Select  = 450;  { Session is not selectable     }
  error_Smg_Session_Not_Foregrnd = 451; { Parent/child session is not foreground }
  error_Smg_Session_Not_Parent  = 452;  { Not parent of requested child }
  error_Smg_Invalid_Start_Mode  = 453;  { Invalid session start mode    }
  error_Smg_Invalid_Related_Opt = 454;  { Invalid session start related option }
  error_Smg_Invalid_Bond_Option = 455;  { Invalid session bond option   }
  error_Smg_Invalid_Select_Opt  = 456;  { Invalid session select option }
  error_Smg_Start_In_Background = 457;  { Session started in background }
  error_Smg_Invalid_Stop_Option = 458;  { Invalid session stop option   }
  error_Smg_Bad_Reserve         = 459;  { Reserved parameters are not zero }
  error_Smg_Process_Not_Parent  = 460;  { Session parent process already exists }
  error_Smg_Invalid_Data_Length = 461;  { Invalid data length           }
  error_Smg_Not_Bound           = 462;  { Parent is not bound           }
  error_Smg_Retry_Sub_Alloc     = 463;  { Retry request block allocation }
  error_Kbd_Detached            = 464;  { This call is not allowed for a detached PID }
  error_Vio_Detached            = 465;  { This call is not allowed for a detached PID }
  error_Mou_Detached            = 466;  { This call is not allowed for a detached PID }
  error_Vio_Font                = 467;  { No font is available to support the mode }
  error_Vio_User_Font           = 468;  { User font is active           }
  error_Vio_Bad_Cp              = 469;  { Invalid code page specified   }
  error_Vio_No_Cp               = 470;  { System displays do not support code page }
  error_Vio_Na_Cp               = 471;  { Current display does not support code page }
  error_Invalid_Code_Page       = 472;  { Invalid code page             }
  error_CpList_Too_Small        = 473;  { Code page list is too small   }
  error_Cp_Not_Moved            = 474;  { Code page was not moved       }
  error_Mode_Switch_Init        = 475;  { Mode switch initialization error }
  error_Code_Page_Not_Found     = 476;  { Code page was not found       }
  error_Unexpected_Slot_Returned = 477; { Internal error                }
  error_Smg_Invalid_Trace_Option = 478; { Invalid start session trace indicator }
  error_Vio_Internal_Resource   = 479;  { VIO internal resource error   }
  error_Vio_Shell_Init          = 480;  { VIO shell initialization error }
  error_Smg_No_Hard_Errors      = 481;  { No session manager hard errors }
  error_Cp_Switch_Incomplete    = 482;  { DosSetProcessCp is unable to set a KBD or VIO code page }
  error_Vio_Transparent_Popup   = 483;  { Error during VIO pop-up window }
  error_CritSec_Overflow        = 484;  { Critical section overflow     }
  error_CritSec_Underflow       = 485;  { Critical section underflow    }
  error_Vio_Bad_Reserve         = 486;  { Reserved parameter is not zero }
  error_Invalid_Address         = 487;  { Invalid physical address      }
  error_Zero_Selectors_Requested = 488; { At least one selector must be requested }
  error_Not_Enough_Selectors_Ava = 489; { Not enough GDT selectors to satisfy request }
  error_Invalid_Selector        = 490;  { Not a GDT selector            }
  error_Smg_Invalid_Program_Type = 491; { Invalid program type          }
  error_Smg_Invalid_Pgm_Control = 492;  { Invalid program control       }
  error_Smg_Invalid_Inherit_Opt = 493;  { Invalid inherit option        }
  error_Vio_Extended_Sg         = 494;  { Vio function not allowed in PM window }
  error_Vio_Not_Pres_Mgr_Sg     = 495;  { Function not supported in non-PM screen group }
  error_Vio_Shield_Owned        = 496;  { Vio shield already owned      }
  error_Vio_No_More_Handles     = 497;  { Vio handles exhausted         }
  error_Vio_See_Error_Log       = 498;  { Vio error occurred, details sent to error log }
  error_Vio_Associated_Dc       = 499;  { Invalid display context       }
  error_Kbd_No_Console          = 500;  { Kbd input not available       }
  error_Mouse_No_Console        = 501;  { Mou input not available       }
  error_Mouse_Invalid_Handle    = 502;  { Invalid mouse handle          }
  error_Smg_Invalid_Debug_Parms = 503;  { Invalid debugging parameters  }
  error_Kbd_Extended_Sg         = 504;  { Kbd function not allowed in PM window }
  error_Mou_Extended_Sg         = 505;  { Mou function not allowed in PM window }
  error_Smg_Invalid_Icon_File   = 506;  { Invalid icon file             }
  error_Trc_Pid_Non_Existent    = 507;  { The specified process doesn't exist }
  error_Trc_Count_Active        = 508;  { RAS trace count is already active }
  error_Trc_Suspended_By_Count  = 509;  { RAS tracing has been suspended }
  error_Trc_Count_Inactive      = 510;  { RAS trace-until-error has not been requested }
  error_Trc_Count_Reached       = 511;  { RAS trace-error-count has reached its limit }
  error_No_Mc_Trace             = 512;  { Minor code RAS tracing is disallowed }
  error_Mc_Trace                = 513;  { The RAS minor or major code table contains an error }
  error_Trc_Count_Zero          = 514;  { The requested RAS trace-until-error is not allowed }
  error_Smg_Too_Many_Dds        = 515;  { Too many device drivers are registered with the Session Manager }
  error_Smg_Invalid_Notification = 516; { The session notification bit map is not correct }
  error_Lf_Invalid_Function     = 517;
  error_Lf_Not_Avail            = 518;
  error_Lf_Suspended            = 519;
  error_Lf_Buf_Too_Small        = 520;
  error_Lf_Buffer_Corrupted     = 521;
  error_Lf_Buffer_Full          = 521;
  error_Lf_Invalid_Daemon       = 522;
  error_Lf_Invalid_Record       = 522;
  error_Lf_Invalid_Templ        = 523;
  error_Lf_Invalid_Service      = 523;
  error_Lf_General_Failure      = 524;
  error_Lf_Invalid_Id           = 525;
  error_Lf_Invalid_Handle       = 526;
  error_Lf_No_Id_Avail          = 527;
  error_Lf_Template_Area_Full   = 528;
  error_Lf_Id_In_Use            = 529;
  error_Mou_Not_Initialized     = 530;
  error_Mouinitreal_Done        = 531;
  error_Dossub_Corrupted        = 532;
  error_Mouse_Caller_Not_Subsys = 533;
  error_Arithmetic_Overflow     = 534;
  error_Tmr_No_Device           = 535;
  error_Tmr_Invalid_Time        = 536;
  error_Pvw_Invalid_Entity      = 537;
  error_Pvw_Invalid_Entity_Type = 538;
  error_Pvw_Invalid_Spec        = 539;
  error_Pvw_Invalid_Range_Type  = 540;
  error_Pvw_Invalid_Counter_Blk = 541;
  error_Pvw_Invalid_Text_Blk    = 542;
  error_Prf_Not_Initialized     = 543;
  error_Prf_Already_Initialized = 544;
  error_Prf_Not_Started         = 545;
  error_Prf_Already_Started     = 546;
  error_Prf_Timer_Out_Of_Range  = 547;
  error_Prf_Timer_Reset         = 548;
  error_VDD_Lock_Useage_Denied  = 639;
  error_Timeout                 = 640;
  error_VDM_Down                = 641;
  error_VDM_Limit               = 642;
  error_VDD_Not_Found           = 643;
  error_Invalid_Caller          = 644;
  error_Pid_Mismatch            = 645;
  error_Invalid_Vdd_Handle      = 646;
  error_VLPT_No_Spooler         = 647;
  error_VCOM_Device_Busy        = 648;
  error_VLPT_Device_Busy        = 649;
  error_Nesting_Too_Deep        = 650;
  error_VDD_Missing             = 651;
  error_Bidi_Invalid_Length     = 671;
  error_Bidi_Invalid_Increment  = 672;
  error_Bidi_Invalid_Combination = 673;
  error_Bidi_Invalid_Reserved   = 674;
  error_Bidi_Invalid_Effect     = 675;
  error_Bidi_Invalid_Csdrec     = 676;
  error_Bidi_Invalid_Csdstate   = 677;
  error_Bidi_Invalid_Level      = 678;
  error_Bidi_Invalid_Type_Support = 679;
  error_Bidi_Invalid_Orientation  = 680;
  error_Bidi_Invalid_Num_Shape  = 681;
  error_Bidi_Invalid_Csd        = 682;
  error_Bidi_No_Support         = 683;
  no_Error_Bidi_Rw_Incomplete   = 684;
  error_Imp_Invalid_Parm        = 691;
  error_Imp_Invalid_Length      = 692;
  error_Mon_Bad_Buffer          = 730;

  error_Module_Corrupted        = 731;

  error_Sm_OutOf_SwapFile       = 1477;

  error_Lf_Timeout              = 2055;
  error_Lf_Suspend_Success      = 2057;
  error_Lf_Resume_Success       = 2058;
  error_Lf_Redirect_Success     = 2059;
  error_Lf_Redirect_Failure     = 2060;


  error_Swapper_Not_Active      = 32768;
  error_Invalid_Swapid          = 32769;
  error_Ioerr_Swap_File         = 32770;
  error_Swap_Table_Full         = 32771;
  error_Swap_File_Full          = 32772;
  error_Cant_Init_Swapper       = 32773;
  error_Swapper_Already_Init    = 32774;
  error_Pmm_Insufficient_Memory = 32775;
  error_Pmm_Invalid_Flags       = 32776;
  error_Pmm_Invalid_Address     = 32777;
  error_Pmm_Lock_Failed         = 32778;
  error_Pmm_Unlock_Failed       = 32779;
  error_Pmm_Move_Incomplete     = 32780;
  error_Ucom_Drive_Renamed      = 32781;
  error_Ucom_Filename_Truncated = 32782;
  error_Ucom_Buffer_Length      = 32783;
  error_Mon_Chain_Handle        = 32784;
  error_Mon_Not_Registered      = 32785;
  error_Smg_Already_Top         = 32786;
  error_Pmm_Arena_Modified      = 32787;
  error_Smg_Printer_Open        = 32788;
  error_Pmm_Set_Flags_Failed    = 32789;
  error_Invalid_Dos_Dd          = 32790;
  error_Blocked                 = 32791;
  error_NoBlock                 = 32792;
  error_Instance_Shared         = 32793;
  error_No_Object               = 32794;
  error_Partial_Attach          = 32795;
  error_Incache                 = 32796;
  error_Swap_IO_Problems        = 32797;
  error_Crosses_Object_Boundary = 32798;
  error_LongLock                = 32799;
  error_ShortLock               = 32800;
  error_UVirtLock               = 32801;
  error_AliasLock               = 32802;
  error_Alias                   = 32803;
  error_No_More_Handles         = 32804;
  error_Scan_Terminated         = 32805;
  error_Terminator_Not_Found    = 32806;
  error_Not_Direct_Child        = 32807;
  error_Delay_Free              = 32808;
  error_Guardpage               = 32809;
  error_Swaperror               = 32900;
  error_Ldrerror                = 32901;
  error_Nomemory                = 32902;
  error_Noaccess                = 32903;
  error_No_Dll_Term             = 32904;
  error_Cpsio_Code_Page_Invalid = 65026;
  error_Cpsio_No_Spooler        = 65027;
  error_Cpsio_Font_Id_Invalid   = 65028;
  error_Cpsio_Internal_Error    = 65033;
  error_Cpsio_Invalid_Ptr_Name  = 65034;
  error_Cpsio_Not_Active        = 65037;
  error_Cpsio_Pid_Full          = 65039;
  error_Cpsio_Pid_Not_Found     = 65040;
  error_Cpsio_Read_Ctl_Seq      = 65043;
  error_Cpsio_Read_Fnt_Def      = 65045;
  error_Cpsio_Write_Error       = 65047;
  error_Cpsio_Write_Full_Error  = 65048;
  error_Cpsio_Write_Handle_Bad  = 65049;
  error_Cpsio_Swit_Load         = 65074;
  error_Cpsio_Inv_Command       = 65077;
  error_Cpsio_No_Font_Swit      = 65078;
  error_Entry_Is_CallGate       = 65079;

implementation

function DosAcknowledgeSignalException; external;
function DosAddMuxWaitSem;              external;
function DosAllocMem;                   external;
function DosAllocSharedMem;             external;
function DosAllocThreadLocalMemory;     external;
function DosAsyncTimer;                 external;
function DosBeep;                       external;
function DosCallNPipe;                  external;
function DosCancelLockRequest;          external;
function DosClose;                      external;
function DosCloseEventSem;              external;
function DosCloseMutexSem;              external;
function DosCloseMuxWaitSem;            external;
function DosCloseQueue;                 external;
function DosCloseVDD;                   external;
function DosConnectNPipe;               external;
function DosCopy;                       external;
function DosCreateDir;                  external;
function DosCreateEventSem;             external;
function DosCreateMutexSem;             external;
function DosCreateMuxWaitSem;           external;
function DosCreateNPipe;                external;
function DosCreatePipe;                 external;
function DosCreateQueue;                external;
function DosCreateThread;               external;
function DosDebug;                      external;
function DosDelete;                     external;
function DosDeleteDir;                  external;
function DosDeleteMuxWaitSem;           external;
function DosDevConfig;                  external;
function DosDevIOCtl;                   external;
function DosDisConnectNPipe;            external;
function DosDupHandle;                  external;
function DosEditName;                   external;
function DosEnterCritSec;               external;
function DosEnterMustComplete;          external;
function DosEnumAttribute;              external;
function DosErrClass;                   external;
function DosError;                      external;
function DosExecPgm;                    external;
function DosExit;                       external;
function DosExitCritSec;                external;
function DosExitList;                   external;
function DosExitMustComplete;           external;
function DosFSAttach;                   external;
function DosFSCtl;                      external;
function DosFindClose;                  external;
function DosFindFirst;                  external;
function DosFindNext;                   external;
function DosForceDelete;                external;
function DosFreeMem;                    external;
function DosFreeModule;                 external;
function DosFreeResource;               external;
function DosFreeThreadLocalMemory;      external;
function DosGetDateTime;                external;
function DosGetInfoBlocks;              external;
function DosGetMessage;                 external;
function DosGetNamedSharedMem;          external;
function DosGetResource;                external;
function DosGetSharedMem;               external;
function DosGiveSharedMem;              external;
function DosInsertMessage;              external;
function DosKillProcess;                external;
function DosKillThread;                 external;
function DosLoadModule;                 external;
function DosMapCase;                    external;
function DosMonClose;                   external;
function DosMonOpen;                    external;
function DosMonRead;                    external;
function DosMonReg;                     external;
function DosMonWrite;                   external;
function DosMove;                       external;
function DosOpen;                       external;
function DosOpenEventSem;               external;
function DosOpenMutexSem;               external;
function DosOpenMuxWaitSem;             external;
function DosOpenQueue;                  external;
function DosOpenVDD;                    external;
function DosPeekNPipe;                  external;
function DosPeekQueue;                  external;
function DosPhysicalDisk;               external;
function DosPostEventSem;               external;
function DosPurgeQueue;                 external;
function DosPutMessage;                 external;
function DosQueryAppType;               external;
function DosQueryCollate;               external;
function DosQueryCp;                    external;
function DosQueryCtryInfo;              external;
function DosQueryCurrentDir;            external;
function DosQueryCurrentDisk;           external;
function DosQueryDBCSEnv;               external;
function DosQueryDOSProperty;           external;
function DosQueryEventSem;              external;
function DosQueryExtLIBPATH;            external;
function DosQueryFHState;               external;
function DosQueryFSAttach;              external;
function DosQueryFSInfo;                external;
function DosQueryFileInfo;              external;
function DosQueryHType;                 external;
function DosQueryMem;                   external;
function DosQueryMessageCP;             external;
function DosQueryModuleHandle;          external;
function DosQueryModuleName;            external;
function DosQueryMutexSem;              external;
function DosQueryMuxWaitSem;            external;
function DosQueryNPHState;              external;
function DosQueryNPipeInfo;             external;
function DosQueryNPipeSemState;         external;
function DosQueryPathInfo;              external;
function DosQueryProcAddr;              external;
function DosQueryProcType;              external;
function DosQueryQueue;                 external;
function DosQueryRASInfo;               external;
function DosQueryResourceSize;          external;
function DosQuerySysInfo;               external;
function DosQueryVerify;                external;
function DosRaiseException;             external;
function DosRawReadNPipe;               external;
function DosRawWriteNPipe;              external;
function DosRead;                       external;
function DosReadQueue;                  external;
function DosRegisterPerfCtrs;           external;
function DosReleaseMutexSem;            external;
function DosRequestMutexSem;            external;
function DosRequestVDD;                 external;
function DosResetBuffer;                external;
function DosResetEventSem;              external;
function DosResumeThread;               external;
function DosScanEnv;                    external;
function DosSearchPath;                 external;
function DosSelectSession;              external;
function DosSendSignalException;        external;
function DosSetCurrentDir;              external;
function DosSetDOSProperty;             external;
function DosSetDateTime;                external;
function DosSetDefaultDisk;             external;
function DosSetExceptionHandler;        external;
function DosSetExtLIBPATH;              external;
function DosSetFHState;                 external;
function DosSetFSInfo;                  external;
function DosSetFileInfo;                external;
function DosSetFileLocks;               external;
function DosSetFilePtr;                 external;
function DosSetFileSize;                external;
function DosSetMaxFH;                   external;
function DosSetMem;                     external;
function DosSetNPHState;                external;
function DosSetNPipeSem;                external;
function DosSetPathInfo;                external;
function DosSetPriority;                external;
function DosSetProcessCp;               external;
function DosSetRelMaxFH;                external;
function DosSetSession;                 external;
function DosSetSignalExceptionFocus;    external;
function DosSetVerify;                  external;
function DosShutdown;                   external;
function DosSleep;                      external;
function DosStartSession;               external;
function DosStartTimer;                 external;
function DosStopSession;                external;
function DosStopTimer;                  external;
function DosSubAllocMem;                external;
function DosSubFreeMem;                 external;
function DosSubSetMem;                  external;
function DosSubUnsetMem;                external;
function DosSuppressPopUps;             external;
function DosSuspendThread;              external;
function DosTmrQueryFreq;               external;
function DosTmrQueryTime;               external;
function DosTransactNPipe;              external;
function DosUnsetExceptionHandler;      external;
function DosUnwindException;            external;
function DosWaitChild;                  external;
function DosWaitEventSem;               external;
function DosWaitMuxWaitSem;             external;
function DosWaitNPipe;                  external;
function DosWaitThread;                 external;
function DosWrite;                      external;
function DosWriteQueue;                 external;
function DosProtectClose;               external;
function DosProtectEnumAttribute;       external;
function DosProtectOpen;                external;
function DosProtectQueryFHState;        external;
function DosProtectQueryFileInfo;       external;
function DosProtectRead;                external;
function DosProtectSetFHState;          external;
function DosProtectSetFileInfo;         external;
function DosProtectSetFileLocks;        external;
function DosProtectSetFilePtr;          external;
function DosProtectSetFileSize;         external;
function DosProtectWrite;               external;
function KbdCharIn;                     external;
function KbdClose;                      external;
function KbdDeRegister;                 external;
function KbdFlushBuffer;                external;
function KbdFreeFocus;                  external;
function KbdGetCp;                      external;
function KbdGetFocus;                   external;
function KbdGetHwId;                    external;
function KbdGetStatus;                  external;
function KbdOpen;                       external;
function KbdPeek;                       external;
function KbdRegister;                   external;
function KbdSetCp;                      external;
function KbdSetCustXt;                  external;
function KbdSetFgnd;                    external;
function KbdSetHwId;                    external;
function KbdSetStatus;                  external;
function KbdStringIn;                   external;
function KbdSynch;                      external;
function KbdXlate;                      external;
function MouClose;                      external;
function MouDeRegister;                 external;
function MouDrawPtr;                    external;
function MouFlushQue;                   external;
function MouGetDevStatus;               external;
function MouGetEventMask;               external;
function MouGetHotKey;                  external;
function MouGetNumButtons;              external;
function MouGetNumMickeys;              external;
function MouGetNumQueEl;                external;
function MouGetPtrPos;                  external;
function MouGetPtrShape;                external;
function MouGetScaleFact;               external;
function MouGetThreshold;               external;
function MouInitReal;                   external;
function MouOpen;                       external;
function MouReadEventQue;               external;
function MouRegister;                   external;
function MouRemovePtr;                  external;
function MouSetDevStatus;               external;
function MouSetEventMask ;              external;
function MouSetHotKey;                  external;
function MouSetPtrPos ;                 external;
function MouSetPtrShape;                external;
function MouSetScaleFact ;              external;
function MouSetThreshold;               external;
function MouSynch;                      external;
function NlsConvertBidiNumerics;        external;
function NlsConvertBidiString;          external;
function NlsEditShape;                  external;
function NlsInverseString;              external;
function NlsQueryBidiAtt;               external;
function NlsSetBidiAtt;                 external;
function NlsSetBidiPrint;               external;
function NlsShapeBidiString;            external;
function VioCheckCharType;              external;
function VioDeRegister;                 external;
function VioEndPopUp;                   external;
function VioGetAnsi;                    external;
function VioGetBuf;                     external;
function VioGetConfig;                  external;
function VioGetCp;                      external;
function VioGetCurPos;                  external;
function VioGetCurType;                 external;
function VioGetFont;                    external;
function VioGetMode;                    external;
function VioGetPhysBuf;                 external;
function VioGetState;                   external;
function VioModeUndo;                   external;
function VioModeWait;                   external;
function VioPopUp;                      external;
function VioPrtSc;                      external;
function VioPrtScToggle;                external;
function VioReadCellStr;                external;
function VioReadCharStr;                external;
function VioRegister;                   external;
function VioSavRedrawUndo;              external;
function VioSavRedrawWait;              external;
function VioScrLock;                    external;
function VioScrUnLock;                  external;
function VioScrollDn;                   external;
function VioScrollLf;                   external;
function VioScrollRt;                   external;
function VioScrollUp;                   external;
function VioSetAnsi;                    external;
function VioSetCp;                      external;
function VioSetCurPos;                  external;
function VioSetCurType;                 external;
function VioSetFont;                    external;
function VioSetMode;                    external;
function VioSetState;                   external;
function VioShowBuf;                    external;
function VioWrtCellStr;                 external;
function VioWrtCharStr;                 external;
function VioWrtCharStrAtt;              external;
function VioWrtNAttr;                   external;
function VioWrtNCell;                   external;
function VioWrtNChar;                   external;
function VioWrtTTY;                     external;
procedure DosFlatToSel;                 external;
procedure DosSelToFlat;                 external;
{function VioRedrawSize;                 external;}

end.
