Ignore:
Timestamp:
Oct 23, 2001, 11:25:46 PM (24 years ago)
Author:
umoeller
Message:

Misc updates.

File:
1 edited

Legend:

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

    r108 r113  
    1414 *@@include #define INCL_WINWORKPLACE
    1515 *@@include #include <os2.h>
    16  *@@include #include "wphandle.h"
     16 *@@include #include "helpers\wphandle.h"
    1717 */
    1818
    19 /*      This file Copyright (C) 1997-2000 Ulrich M”ller,
    20  *                                        Henk Kelder.
     19/*      This file Copyright (C) 1997-2001 Ulrich M”ller.
    2120 *      This file is part of the "XWorkplace helpers" source package.
    2221 *      This is free software; you can redistribute it and/or modify
     
    5150    #define ERROR_WPH_CORRUPT_HANDLES_DATA          (ERROR_WPH_FIRST +   5)
    5251    #define ERROR_WPH_INVALID_PARENT_HANDLE         (ERROR_WPH_FIRST +   6)
     52    #define ERROR_WPH_CANNOT_FIND_HANDLE            (ERROR_WPH_FIRST +   7)
     53    #define ERROR_WPH_DRIV_TREEINSERT_FAILED        (ERROR_WPH_FIRST +   8)
     54    #define ERROR_WPH_NODE_TREEINSERT_FAILED        (ERROR_WPH_FIRST +   9)
     55    #define ERROR_WPH_NODE_BEFORE_DRIV              (ERROR_WPH_FIRST +  10)
     56    #define ERROR_WPH_NO_MATCHING_DRIVE_BLOCK       (ERROR_WPH_FIRST +  11)
     57    #define ERROR_WPH_NO_MATCHING_ROOT_DIR          (ERROR_WPH_FIRST +  12)
    5358
    5459    /* ******************************************************************
     
    95100        USHORT  usUnknown2[2];
    96101        CHAR    szName[1];
    97     } DRIV, *PDRIV;
     102    } DRIVE, *PDRIVE;
    98103
    99104    #pragma pack()
    100105
    101     /*
    102      *@@ WPHANDLESBUF:
    103      *      structure created by wphLoadHandles.
    104      *
    105      *@@added V0.9.16 (2001-10-02) [umoeller]
    106      */
    107 
    108     typedef struct _WPHANDLESBUF
    109     {
    110         PBYTE       pbData;         // ptr to all handles (buffers from OS2SYS.INI)
    111         ULONG       cbData;         // byte count of *p
    112 
    113         USHORT      usHiwordAbstract,   // hiword for WPAbstract handles
    114                     usHiwordFileSystem; // hiword for WPFileSystem handles
    115 
    116         PNODE       NodeHashTable[65536];
    117         BOOL        fNodeHashTableValid;    // TRUE after wphRebuildNodeHashTable
    118 
    119     } HANDLESBUF, *PHANDLESBUF;
     106    /* ******************************************************************
     107     *
     108     *   Private declarations
     109     *
     110     ********************************************************************/
     111
     112    #ifdef INCLUDE_WPHANDLE_PRIVATE
     113
     114        /*
     115         *@@ DRIVETREENODE:
     116         *
     117         *@@added V0.9.16 (2001-10-19) [umoeller]
     118         */
     119
     120        typedef struct _DRIVETREENODE
     121        {
     122            TREE        Tree;       // ulKey points to the DRIVE.szName
     123                                    // (null terminated)
     124            PDRIVE      pDriv;      // actual DRIVE node
     125
     126            TREE        *ChildrenTree;  // NODETREENODE's, if any
     127            LONG        cChildren;
     128
     129        } DRIVETREENODE, *PDRIVETREENODE;
     130
     131        /*
     132         *@@ NODETREENODE:
     133         *
     134         *@@added V0.9.16 (2001-10-19) [umoeller]
     135         */
     136
     137        typedef struct _NODETREENODE
     138        {
     139            TREE        Tree;       // ulKey points to the NODE.szName
     140                                    // (null terminated)
     141            PNODE       pNode;      // actual NODE node
     142
     143            TREE        *ChildrenTree;  // NODETREENODE's, if any
     144            LONG        cChildren;
     145
     146        } NODETREENODE, *PNODETREENODE;
     147
     148        /*
     149         *@@ WPHANDLESBUF:
     150         *      structure created by wphLoadHandles.
     151         *
     152         *      The composed BLOCKs in the handles buffer make up a tree of
     153         *      DRIVE and NODE structures (see wphandle.h). Each NODE stands
     154         *      for either a directory or a file. (We don't care about the
     155         *      DRIVE structures because the root directory gets a NODE also.)
     156         *      Each NODE contains the non-qualified file name, an fshandle,
     157         *      and the fshandle of its parent NODE.
     158         *
     159         *@@added V0.9.16 (2001-10-02) [umoeller]
     160         */
     161
     162        typedef struct _WPHANDLESBUF
     163        {
     164            PBYTE       pbData;         // ptr to all handles (buffers from OS2SYS.INI)
     165            ULONG       cbData;         // byte count of *p
     166
     167            USHORT      usHiwordAbstract,   // hiword for WPAbstract handles
     168                        usHiwordFileSystem; // hiword for WPFileSystem handles
     169
     170            BOOL        fCacheValid;            // TRUE after wphRebuildNodeHashTable()
     171            PNODETREENODE NodeHashTable[65536]; // hash table with all nodes sorted by handle;
     172                                                // if item is NULL, no handle is assigned
     173            TREE        *DrivesTree;          // DRIVETREENODE structs really
     174            LONG        cDrives;
     175
     176            LINKLIST    llDuplicateHandles;     // linked list of NODETREENODE's that
     177                                                // have an fshandle that was already
     178                                                // occupied (i.e. same fshandle for two
     179                                                // NODEs)
     180            LINKLIST    llDuplicateShortNames;
     181
     182        } HANDLESBUF, *PHANDLESBUF;
     183
     184    #endif
    120185
    121186    /* ******************************************************************
     
    124189     *
    125190     ********************************************************************/
     191
     192    typedef unsigned long HHANDLES;
    126193
    127194    APIRET wphQueryActiveHandles(HINI hiniSystem,
     
    132199                                      PUSHORT pusHiwordFileSystem);
    133200
    134     APIRET wphRebuildNodeHashTable(PHANDLESBUF pHandlesBuf);
     201    APIRET wphRebuildNodeHashTable(HHANDLES hHandles);
    135202
    136203    APIRET wphLoadHandles(HINI hiniUser,
    137204                          HINI hiniSystem,
    138205                          const char *pcszActiveHandles,
    139                           PHANDLESBUF *ppHandlesBuf);
    140 
    141     APIRET wphFreeHandles(PHANDLESBUF *ppHandlesBuf);
     206                          HHANDLES *phHandles);
     207
     208    APIRET wphFreeHandles(HHANDLES *phHandles);
    142209
    143210    APIRET wphQueryHandleFromPath(HINI hiniUser,
     
    146213                                  HOBJECT *phobj);
    147214
    148     APIRET wphComposePath(PHANDLESBUF pHandlesBuf,
     215    APIRET wphComposePath(HHANDLES hHandles,
    149216                          USHORT usHandle,
    150217                          PSZ pszFilename,
Note: See TracChangeset for help on using the changeset viewer.