Ignore:
Timestamp:
Jan 31, 2002, 11:12:45 PM (24 years ago)
Author:
umoeller
Message:

Misc speed improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/dosh.h

    r133 r135  
    3232#ifndef DOSH_HEADER_INCLUDED
    3333    #define DOSH_HEADER_INCLUDED
     34
     35    /* ******************************************************************
     36     *
     37     *   Wrappers
     38     *
     39     ********************************************************************/
     40
     41    // if DOSH_STANDARDWRAPPERS is #define'd before including dosh.h,
     42    // all the following Dos* API calls are redirected to the dosh*
     43    // counterparts
     44
     45    #ifdef DOSH_STANDARDWRAPPERS
     46
     47        #ifdef INCL_DOSPROCESS
     48
     49            APIRET XWPENTRY doshSleep(ULONG msec);
     50            #define DosSleep(a) doshSleep((a))
     51
     52        #endif
     53
     54        #ifdef INCL_DOSSEMAPHORES
     55
     56            APIRET XWPENTRY doshCreateMutexSem(PSZ pszName,
     57                                               PHMTX phmtx,
     58                                               ULONG flAttr,
     59                                               BOOL32 fState);
     60            #define DosCreateMutexSem(a, b, c, d) doshCreateMutexSem((a), (b), (c), (d))
     61
     62            APIRET XWPENTRY doshRequestMutexSem(HMTX hmtx, ULONG ulTimeout);
     63            #define DosRequestMutexSem(h, t) doshRequestMutexSem((h), (t))
     64
     65            APIRET XWPENTRY doshReleaseMutexSem(HMTX hmtx);
     66            #define DosReleaseMutexSem(h) doshReleaseMutexSem((h))
     67
     68        #endif
     69
     70        #ifdef INCL_DOSEXCEPTIONS
     71
     72            APIRET XWPENTRY doshSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
     73            #define DosSetExceptionHandler(a) doshSetExceptionHandler((a))
     74
     75            APIRET XWPENTRY doshUnsetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec);
     76            #define DosUnsetExceptionHandler(a) doshUnsetExceptionHandler((a))
     77
     78        #endif
     79
     80    #endif
    3481
    3582    /* ******************************************************************
     
    162209                                   PBIOSPARAMETERBLOCK pdp);
    163210
    164         BYTE doshQueryRemoveableType(PBIOSPARAMETERBLOCK pdp);
     211        BYTE doshQueryDriveType(ULONG ulLogicalDrive,
     212                                PBIOSPARAMETERBLOCK pdp,
     213                                BOOL fFixed);
    165214
    166215        APIRET XWPENTRY doshHasAudioCD(ULONG ulLogicalDrive,
     
    185234    #define DRVFL_MIXEDMODECD        0x0001
    186235    #define DRVFL_TOUCHFLOPPIES      0x0002
     236    #define DRVFL_CHECKEAS           0x0004
     237    #define DRVFL_CHECKLONGNAMES     0x0008
    187238
    188239    APIRET doshAssertDrive(ULONG ulLogicalDrive,
     
    222273                            // 0x1a USHORT cCylinders;
    223274                            // 0x1c BYTE   bDeviceType;
    224                                     // DEVTYPE_48TPI                      0x0000
    225                                     // DEVTYPE_96TPI                      0x0001
    226                                     // DEVTYPE_35                         0x0002
    227                                     // DEVTYPE_8SD                        0x0003
    228                                     // DEVTYPE_8DD                        0x0004
    229                                     // DEVTYPE_FIXED                      0x0005
    230                                     // DEVTYPE_TAPE                       0x0006
    231                                     // DEVTYPE_UNKNOWN                    0x0007
     275                                #ifndef DEVTYPE_48TPI
     276                                #define DEVTYPE_48TPI                      0x0000
     277                                #define DEVTYPE_96TPI                      0x0001
     278                                #define DEVTYPE_35                         0x0002
     279                                #define DEVTYPE_8SD                        0x0003
     280                                #define DEVTYPE_8DD                        0x0004
     281                                #define DEVTYPE_FIXED                      0x0005
     282                                #define DEVTYPE_TAPE                       0x0006
     283                                #endif
     284                                #define DEVTYPE_OTHER                      0x0007
     285                                            // includes 1.44 3.5" floppy
     286                                #define DEVTYPE_RWOPTICAL                  0x0008
     287                                #define DEVTYPE_35_288MB                   0x0009
    232288                            // 0x1d USHORT fsDeviceAttr;
    233289                                #define DEVATTR_REMOVEABLE              0x0001
     
    240296                                            // addresses > 16 MB
    241297                                #define DEVATTR_PARTITIONALREMOVEABLE   0x0008
     298                                            // undocumented flag; set for ZIP drives
    242299
    243300            BYTE        bType;
    244301                // do not change these codes, XWorkplace relies
    245302                // on them too to parse WPDisk data
    246                 #define DRVTYPE_HARDDISK        0
    247                 #define DRVTYPE_FLOPPY          1
    248                 #define DRVTYPE_TAPE            2
    249                 #define DRVTYPE_VDISK           3
    250                 #define DRVTYPE_CDROM           4
    251                 #define DRVTYPE_LAN             5
     303                #define DRVTYPE_HARDDISK                0
     304                #define DRVTYPE_FLOPPY                  1
     305                #define DRVTYPE_TAPE                    2
     306                #define DRVTYPE_VDISK                   3
     307                #define DRVTYPE_CDROM                   4
     308                #define DRVTYPE_LAN                     5
    252309                #define DRVTYPE_PARTITIONABLEREMOVEABLE 6
    253                 #define DRVTYPE_UNKNOWN       255
     310                #define DRVTYPE_UNKNOWN               255
    254311
    255312            ULONG       flDevice;
     
    259316                #define DFL_FIXED                       0x0002
    260317                            // drive is fixed; otherwise it is removeable!
     318                            // always set for harddisks and zip drives
    261319                #define DFL_PARTITIONABLEREMOVEABLE     0x0004
     320                            // set for zip drives;
    262321                            // in that case, DFL_FIXED is set also
    263322                #define DFL_BOOTDRIVE                   0x0008
     
    267326
    268327                #define DFL_MEDIA_PRESENT               0x1000
    269                             // media is present in drive; always
    270                             // true for fixed and remove drives and
    271                             // drives A: and B:
     328                            // media is present in drive;
     329                            // -- always set for harddisks,
     330                            //    unless the file system is not
     331                            //    understood
     332                            // -- always set for remove drives
     333                            // -- always set for A: and B:
     334                            // -- set for CD-ROMS only if data
     335                            //    CD-ROM is inserted
    272336                #define DFL_AUDIO_CD                    0x2000
    273337                            // set for CD-ROMs only, if an audio CD
     
    276340                #define DFL_SUPPORTS_EAS                0x4000
    277341                            // drive supports extended attributes
     342                            // (assumption based on DosFSCtl,
     343                            // might not be correct for remote drives;
     344                            // reports correctly for FAT32 though)
    278345                #define DFL_SUPPORTS_LONGNAMES          0x8000
    279346                            // drive supports long names; this does not
     
    287354                            // e.g. "FAT" or "HPFS" or "JFS" or "CDFS"
    288355
    289             BYTE        bFileSystem;
     356            LONG        lFileSystem;
    290357                // do not change these codes, XWorkplace relies
    291358                // on them too to parse WPDisk data
     359                #define FSYS_UNKNOWN         0
     360                            // drive not formatted, or unknown file system
    292361                #define FSYS_FAT             1
    293362                #define FSYS_HPFS_JFS        2
    294363                #define FSYS_CDFS            3
    295                 #define FSYS_FAT32           8      // not used by WPS!
     364                #define FSYS_TVFS            7      // not used by WPS!
     365                #define FSYS_FAT32_EXT2      8      // not used by WPS!
    296366                #define FSYS_RAMFS           9      // not used by WPS!
    297367                #define FSYS_REMOTE         10
     368                // NOTE: if this has a negative value, this is
     369                // the APIRET code from DosQueryFSAttach
     370
     371            // error codes for various operations
     372            APIRET  arcIsFixedDisk,
     373                    arcQueryDiskParams,
     374                    arcQueryMedia,
     375                    arcOpenLongnames;
    298376
    299377        } XDISKINFO, *PXDISKINFO;
     
    477555    {
    478556        HFILE       hf;
    479         ULONG       hmtx;       // a HMTX really
     557        // ULONG       hmtx;       // a HMTX really
    480558
    481559        PSZ         pszFilename;    // as given to doshOpen
     
    812890     ********************************************************************/
    813891
     892    BOOL doshMatchCase(PCSZ pcszMask,
     893                       PCSZ pcszName);
     894
    814895    BOOL doshMatch(PCSZ pcszMask,
    815896                   PCSZ pcszName);
Note: See TracChangeset for help on using the changeset viewer.