Changeset 257 for trunk/include/helpers


Ignore:
Timestamp:
Jan 8, 2004, 5:43:29 PM (22 years ago)
Author:
umoeller
Message:

Fixes that have piled up in the last three months.

Location:
trunk/include/helpers
Files:
7 edited

Legend:

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

    r253 r257  
    721721    typedef ULONG XWPENTRY DOSHMYPID(VOID);
    722722    typedef DOSHMYPID *PDOSHMYPID;
     723
     724    ULONG doshMyParentPID(VOID);
    723725
    724726    ULONG XWPENTRY doshMyTID(VOID);
  • trunk/include/helpers/exeh.h

    r242 r257  
    11571157        //      (NOSTUB, V0.9.12);
    11581158        // --   for .COM, .BAT, .CMD files (V0.9.16)
    1159         PDOSEXEHEADER   pDosExeHeader;
    1160         ULONG           cbDosExeHeader;
     1159        DOSEXEHEADER    DosExeHeader;       // no longer a ptr, but inline struct V1.0.2 (2003-11-13) [umoeller]
     1160        ULONG           cbDosExeHeader;     // if != 0, DosExeHeader is present
    11611161
    11621162        // New Executable (NE) header, if ulExeFormat == EXEFORMAT_NE
     
    13531353                              ULONG idResource,
    13541354                              PBYTE *ppbResData,
     1355                              PULONG pulOffset,
    13551356                              PULONG pcbResData);
    13561357
  • trunk/include/helpers/lan.h

    r229 r257  
    33 *@@sourcefile lan.h:
    44 *      header file for lan.c. See notes there.
     5 *
     6 *      Since the LAN headers are so confusing and maybe not
     7 *      everyone has them, we duplicate all definitions that
     8 *      we need here.
    59 *
    610 *      Note: Version numbering in this file relates to XWorkplace version
     
    3236    #define LANH_HEADER_INCLUDED
    3337
     38    #ifndef NERR_NetNotStarted
     39        #define NERR_BASE       2100
     40
     41        #define NERR_NetNotStarted      (NERR_BASE+2)   /* The workstation driver (NETWKSTA.SYS on OS/2 workstations, NETWKSTA.EXE on DOS workstations) isn't installed. */
     42        #define NERR_UnknownServer      (NERR_BASE+3)   /* The server cannot be located. */
     43        #define NERR_ShareMem           (NERR_BASE+4)   /* An internal error occurred.  The network cannot access a shared memory segment. */
     44        #define NERR_NoNetworkResource  (NERR_BASE+5)   /* A network resource shortage occurred . */
     45        #define NERR_RemoteOnly         (NERR_BASE+6)   /* This operation is not supported on workstations. */
     46        #define NERR_DevNotRedirected   (NERR_BASE+7)   /* The device is not connected. */
     47        #define Dhcpwaitmsg             (NERR_BASE+8)   /* Waiting for response from DHCP server */
     48        #define DhcpCompletemsg         (NERR_BASE+9)   /* Successful response received from DHCP server */
     49        #define NERR_ServerNotStarted   (NERR_BASE+14)  /* The Server service isn't started. */
     50        #define NERR_ItemNotFound       (NERR_BASE+15)  /* The queue is empty. */
     51        #define NERR_UnknownDevDir      (NERR_BASE+16)  /* The device or directory does not exist. */
     52        #define NERR_RedirectedPath     (NERR_BASE+17)  /* The operation is invalid on a redirected resource. */
     53        #define NERR_DuplicateShare     (NERR_BASE+18)  /* The name has already been shared. */
     54        #define NERR_NoRoom             (NERR_BASE+19)  /* The server is currently out of the requested resource. */
     55        #define NERR_TooManyItems       (NERR_BASE+21)  /* Requested add of item exceeds maximum allowed. */
     56        #define NERR_InvalidMaxUsers    (NERR_BASE+22)  /* The Peer service supports only two simultaneous users. */
     57        #define NERR_BufTooSmall        (NERR_BASE+23)  /* The API return buffer is too small. */
     58        #define NERR_RemoteErr          (NERR_BASE+27)  /* A remote API error occurred.  */
     59        #define NERR_LanmanIniError     (NERR_BASE+31)  /* An error occurred when opening or reading IBMLAN.INI. */
     60        #define NERR_OS2IoctlError      (NERR_BASE+34)  /* An internal error occurred when calling the workstation driver. */
     61        #define NERR_NetworkError       (NERR_BASE+36)  /* A general network error occurred. */
     62        #define NERR_WkstaNotStarted    (NERR_BASE+38)  /* The Requester service has not been started. */
     63        #define NERR_InternalError      (NERR_BASE+40)  /* An internal LAN Manager error occurred.*/
     64        #define NERR_BadTransactConfig  (NERR_BASE+41)  /* The server is not configured for transactions. */
     65        #define NERR_InvalidAPI         (NERR_BASE+42)  /* The requested API isn't supported on the remote server. */
     66        #define NERR_BadEventName       (NERR_BASE+43)  /* The event name is invalid. */
     67
     68        #define NERR_CfgCompNotFound    (NERR_BASE+46)  /* Could not find the specified component in IBMLAN.INI. */
     69        #define NERR_CfgParamNotFound   (NERR_BASE+47)  /* Could not find the specified parameter in IBMLAN.INI. */
     70        #define NERR_LineTooLong        (NERR_BASE+49)  /* A line in IBMLAN.INI is too long. */
     71
     72        #define NERR_QNotFound          (NERR_BASE+50)  /* The printer queue does not exist. */
     73        #define NERR_JobNotFound        (NERR_BASE+51)  /* The print job does not exist. */
     74        #define NERR_DestNotFound       (NERR_BASE+52)  /* The printer destination cannot be found. */
     75        #define NERR_DestExists         (NERR_BASE+53)  /* The printer destination already exists. */
     76        #define NERR_QExists            (NERR_BASE+54)  /* The printer queue already exists. */
     77        #define NERR_QNoRoom            (NERR_BASE+55)  /* No more printer queues can be added. */
     78        #define NERR_JobNoRoom          (NERR_BASE+56)  /* No more print jobs can be added.  */
     79        #define NERR_DestNoRoom         (NERR_BASE+57)  /* No more printer destinations can be added. */
     80        #define NERR_DestIdle           (NERR_BASE+58)  /* This printer destination is idle and cannot accept control operations. */
     81        #define NERR_DestInvalidOp      (NERR_BASE+59)  /* This printer destination request contains an invalid control function. */
     82        #define NERR_ProcNoRespond      (NERR_BASE+60)  /* The printer processor is not responding. */
     83        #define NERR_SpoolerNotLoaded   (NERR_BASE+61)  /* The spooler is not running. */
     84        #define NERR_DestInvalidState   (NERR_BASE+62)  /* This operation cannot be performed on the print destination in its current state. */
     85        #define NERR_QInvalidState      (NERR_BASE+63)  /* This operation cannot be performed on the printer queue in its current state. */
     86        #define NERR_JobInvalidState    (NERR_BASE+64)  /* This operation cannot be performed on the print job in its current state. */
     87        #define NERR_SpoolNoMemory      (NERR_BASE+65)  /* A spooler memory allocation failure occurred. */
     88        #define NERR_DriverNotFound     (NERR_BASE+66)  /* The device driver does not exist. */
     89        #define NERR_DataTypeInvalid    (NERR_BASE+67)  /* The datatype is not supported by the processor. */
     90        #define NERR_ProcNotFound       (NERR_BASE+68)  /* The print processor is not installed. */
     91
     92        #define NERR_ServiceTableLocked (NERR_BASE+80)  /* The service does not respond to control actions. */
     93        #define NERR_ServiceTableFull   (NERR_BASE+81)  /* The service table is full. */
     94        #define NERR_ServiceInstalled   (NERR_BASE+82)  /* The requested service has already been started. */
     95        #define NERR_ServiceEntryLocked (NERR_BASE+83)  /* The service does not respond to control actions. */
     96        #define NERR_ServiceNotInstalled (NERR_BASE+84) /* The service has not been started. */
     97        #define NERR_BadServiceName     (NERR_BASE+85)  /* The service name is invalid. */
     98        #define NERR_ServiceCtlTimeout  (NERR_BASE+86)  /* The service is not responding to the control function. */
     99        #define NERR_ServiceCtlBusy     (NERR_BASE+87)  /* The service control is busy. */
     100        #define NERR_BadServiceProgName (NERR_BASE+88)  /* IBMLAN.INI contains an invalid service program name. */
     101        #define NERR_ServiceNotCtrl     (NERR_BASE+89)  /* The service cannot be controlled in its present state. */
     102        #define NERR_ServiceKillProc    (NERR_BASE+90)  /* The service ended abnormally. */
     103        #define NERR_ServiceCtlNotValid (NERR_BASE+91)  /* The requested pause or stop is not valid for this service. */
     104
     105        #define NERR_AlreadyLoggedOn    (NERR_BASE+100) /* This workstation is already logged on to the local-area network. */
     106        #define NERR_NotLoggedOn        (NERR_BASE+101) /* The workstation isn't logged on to the local-area network. */
     107        #define NERR_BadUsername        (NERR_BASE+102) /* The username or groupname parameter is invalid.  */
     108        #define NERR_BadPassword        (NERR_BASE+103) /* The password parameter is invalid. */
     109        #define NERR_UnableToAddName_W  (NERR_BASE+104) /* @W The logon processor did not add the message alias. */
     110        #define NERR_UnableToAddName_F  (NERR_BASE+105) /* The logon processor did not add the message alias. */
     111        #define NERR_UnableToDelName_W  (NERR_BASE+106) /* @W The logoff processor did not delete the message alias. */
     112        #define NERR_UnableToDelName_F  (NERR_BASE+107) /* The logoff processor did not delete the message alias. */
     113        #define NERR_LogonsPaused       (NERR_BASE+109) /* Network logons are paused. */
     114        #define NERR_LogonServerConflict (NERR_BASE+110)/* A centralized logon-server conflict occurred. */
     115        #define NERR_LogonScriptError   (NERR_BASE+112) /* An error occurred while loading or running the logon script. */
     116        #define NERR_StandaloneLogon    (NERR_BASE+114) /* The logon server was not specified.  Your computer will be logged on as STANDALONE. */
     117        #define NERR_LogonServerNotFound (NERR_BASE+115) /* The logon server cannot be found.  */
     118        #define NERR_NonValidatedLogon  (NERR_BASE+117) /* The logon server could not validate the logon. */
     119
     120        #define NERR_AccountUndeletable (NERR_BASE+118) /* The user account is marked undeletable. */
     121        #define NERR_ACFNotFound        (NERR_BASE+119) /* The accounts file NET.ACC cannot be found. */
     122        #define NERR_GroupNotFound      (NERR_BASE+120) /* The groupname cannot be found. */
     123        #define NERR_UserNotFound       (NERR_BASE+121) /* The username cannot be found. */
     124        #define NERR_ResourceNotFound   (NERR_BASE+122) /* The resource name cannot be found.  */
     125        #define NERR_GroupExists        (NERR_BASE+123) /* The group already exists. */
     126        #define NERR_UserExists         (NERR_BASE+124) /* The user account already exists. */
     127        #define NERR_ResourceExists     (NERR_BASE+125) /* The resource permission list already exists. */
     128        #define NERR_NotPrimary         (NERR_BASE+126) /* The UAS database is replicant and will not allow updates. */
     129        #define NERR_ACFNotLoaded       (NERR_BASE+127) /* The user account system has not been started. */
     130        #define NERR_ACFNoRoom          (NERR_BASE+128) /* There are too many names in the user account system. */
     131        #define NERR_ACFFileIOFail      (NERR_BASE+129) /* A disk I/O failure occurred.*/
     132        #define NERR_ACFTooManyLists    (NERR_BASE+130) /* The limit of 64 entries per resource was exceeded. */
     133        #define NERR_UserLogon          (NERR_BASE+131) /* Deleting a user with a session is not allowed. */
     134        #define NERR_ACFNoParent        (NERR_BASE+132) /* The parent directory cannot be located. */
     135        #define NERR_CanNotGrowSegment  (NERR_BASE+133) /* Unable to grow UAS session cache segment. */
     136        #define NERR_SpeGroupOp         (NERR_BASE+134) /* This operation is not allowed on this special group. */
     137        #define NERR_NotInCache         (NERR_BASE+135) /* This user is not cached in UAS session cache. */
     138        #define NERR_UserInGroup        (NERR_BASE+136) /* The user already belongs to this group. */
     139        #define NERR_UserNotInGroup     (NERR_BASE+137) /* The user does not belong to this group. */
     140        #define NERR_AccountUndefined   (NERR_BASE+138) /* This user account is undefined. */
     141        #define NERR_AccountExpired     (NERR_BASE+139) /* This user account has expired. */
     142        #define NERR_InvalidRequester (NERR_BASE+140) /* The user is not allowed to log on from this workstation. */
     143        #define NERR_InvalidLogonHours  (NERR_BASE+141) /* The user is not allowed to log on at this time.  */
     144        #define NERR_PasswordExpired    (NERR_BASE+142) /* The password of this user has expired. */
     145        #define NERR_PasswordCantChange (NERR_BASE+143) /* The password of this user cannot change. */
     146        #define NERR_PasswordHistConflict (NERR_BASE+144) /* This password cannot be used now. */
     147        #define NERR_PasswordTooShort   (NERR_BASE+145) /* The password is shorter than required. */
     148        #define NERR_PasswordTooRecent  (NERR_BASE+146) /* The password of this user is too recent to change.  */
     149        #define NERR_InvalidDatabase    (NERR_BASE+147) /* The UAS database file is corrupted. */
     150        #define NERR_DatabaseUpToDate   (NERR_BASE+148) /* No updates are necessary to this replicant UAS database. */
     151        #define NERR_SyncRequired       (NERR_BASE+149) /* This replicant database is outdated; synchronization is required. */
     152
     153        /*
     154         *      Use API related
     155         *              Error codes from BASE+150 to BASE+169
     156         */
     157
     158        #define NERR_UseNotFound        (NERR_BASE+150) /* The connection cannot be found. */
     159        #define NERR_BadAsgType         (NERR_BASE+151) /* This asg_type is invalid. */
     160        #define NERR_DeviceIsShared     (NERR_BASE+152) /* This device is currently being shared. */
     161
     162        /*
     163         *      Message Server related
     164         *              Error codes BASE+170 to BASE+209
     165         */
     166
     167        #define NERR_NoComputerName     (NERR_BASE+170) /* A computername has not been configured.  */
     168        #define NERR_MsgAlreadyStarted  (NERR_BASE+171) /* The Messenger service is already started. */
     169        #define NERR_MsgInitFailed      (NERR_BASE+172) /* The Messenger service failed to start.  */
     170        #define NERR_NameNotFound       (NERR_BASE+173) /* The message alias cannot be found on the local-area network. */
     171        #define NERR_AlreadyForwarded   (NERR_BASE+174) /* This message alias has already been forwarded. */
     172        #define NERR_AlreadyExists      (NERR_BASE+176) /* This message alias already exists locally. */
     173        #define NERR_TooManyNames       (NERR_BASE+177) /* The maximum number of added message aliases has been exceeded. */
     174        #define NERR_DelComputerName    (NERR_BASE+178) /* The computername cannot be deleted.*/
     175        #define NERR_LocalForward       (NERR_BASE+179) /* Messages cannot be forwarded back to the same workstation. */
     176        #define NERR_GrpMsgProcessor    (NERR_BASE+180) /* Error in domain message processor */
     177        #define NERR_PausedRemote       (NERR_BASE+181) /* The message was sent, but the recipient has paused the Messenger service. */
     178        #define NERR_BadReceive         (NERR_BASE+182) /* The message was sent but not received. */
     179        #define NERR_NameInUse          (NERR_BASE+183) /* The message alias is currently in use. Try again later. */
     180        #define NERR_MsgNotStarted      (NERR_BASE+184) /* The Messenger service has not been started. */
     181        #define NERR_NotLocalName       (NERR_BASE+185) /* The name is not on the local computer. */
     182        #define NERR_NoForwardName      (NERR_BASE+186) /* The forwarded message alias cannot be found on the network. */
     183        #define NERR_RemoteFull         (NERR_BASE+187) /* The message alias table on the remote station is full. */
     184        #define NERR_NameNotForwarded   (NERR_BASE+188) /* Messages for this alias are not currently being forwarded. */
     185        #define NERR_TruncatedBroadcast (NERR_BASE+189) /* The broadcast message was truncated. */
     186        #define NERR_InvalidDevice      (NERR_BASE+194) /* This is an invalid devicename. */
     187        #define NERR_WriteFault         (NERR_BASE+195) /* A write fault occurred. */
     188        #define NERR_DuplicateName      (NERR_BASE+197) /* A duplicate message alias exists on the local-area network. */
     189        #define NERR_DeleteLater        (NERR_BASE+198) /* @W This message alias will be deleted later. */
     190        #define NERR_IncompleteDel      (NERR_BASE+199) /* The message alias was not successfully deleted from all networks. */
     191        #define NERR_MultipleNets       (NERR_BASE+200) /* This operation is not supported on machines with multiple networks. */
     192
     193        #define NERR_DASDNotInstalled         (NERR_BASE+201)
     194        #define NERR_DASDAlreadyInstalled     (NERR_BASE+202)
     195        #define NERR_NotHPFSVolume            (NERR_BASE+203)
     196        #define NERR_DASDMaxValidationFailed  (NERR_BASE+204)
     197        #define NERR_DASDInstallVolumeLocked  (NERR_BASE+205)
     198        #define NERR_LimitNotFound            (NERR_BASE+206)
     199        #define NERR_LimitExists              (NERR_BASE+207)
     200        #define NERR_DASDNotRunning           (NERR_BASE+208)
     201        #define NERR_DASDNotOperational       (NERR_BASE+209)
     202
     203        #define NERR_NetNameNotFound    (NERR_BASE+210) /* This shared resource does not exist.*/
     204        #define NERR_DeviceNotShared    (NERR_BASE+211) /* This device is not shared. */
     205        #define NERR_ClientNameNotFound (NERR_BASE+212) /* A session does not exist with that computername. */
     206        #define NERR_FileIdNotFound     (NERR_BASE+214) /* There isn't an open file with that ID number. */
     207        #define NERR_ExecFailure        (NERR_BASE+215) /* A failure occurred when executing a remote administration command. */
     208        #define NERR_TmpFile            (NERR_BASE+216) /* A failure occurred when opening a remote temporary file. */
     209        #define NERR_TooMuchData        (NERR_BASE+217) /* The data returned from a remote administration command has been truncated to 64K. */
     210        #define NERR_DeviceShareConflict (NERR_BASE+218) /* This device cannot be shared as both a spooled and a non-spooled resource. */
     211        #define NERR_BrowserTableIncomplete (NERR_BASE+219)  /* The information in the list of servers may be incorrect. */
     212        #define NERR_NotLocalDomain     (NERR_BASE+220) /* The computer isn't active on this domain. */
     213
     214        #define NERR_RedirectionsNotFound       (NERR_BASE+221)
     215        #define NERR_LocalPathWarning           (NERR_BASE+222)
     216        #define NERR_AssignmentNotMade          (NERR_BASE+223)
     217        #define NERR_ItemNotAssigned            (NERR_BASE+224)
     218        #define NERR_CantAddAssignments         (NERR_BASE+225)
     219        #define NERR_CantSetAssignments         (NERR_BASE+226)
     220        #define NERR_DomainSpecificInfo         (NERR_BASE+227)
     221        #define NERR_TooManyLogonAsn            (NERR_BASE+228)
     222        #define NERR_DASDNoAPARs                (NERR_BASE+229)
     223
     224        #define NERR_DevInvalidOpCode   (NERR_BASE+231) /* The operation is invalid for this device. */
     225        #define NERR_DevNotFound        (NERR_BASE+232) /* This device cannot be shared. */
     226        #define NERR_DevNotOpen         (NERR_BASE+233) /* This device was not open. */
     227        #define NERR_BadQueueDevString  (NERR_BASE+234) /* This devicename list is invalid. */
     228        #define NERR_BadQueuePriority   (NERR_BASE+235) /* The queue priority is invalid. */
     229        #define NERR_NoCommDevs         (NERR_BASE+237) /* There are no shared communication devices. */
     230        #define NERR_QueueNotFound      (NERR_BASE+238) /* The queue you specified doesn't exist. */
     231        #define NERR_BadDevString       (NERR_BASE+240) /* This list of devices is invalid. */
     232        #define NERR_BadDev             (NERR_BASE+241) /* The requested device is invalid. */
     233        #define NERR_InUseBySpooler     (NERR_BASE+242) /* This device is already in use by the spooler. */
     234        #define NERR_CommDevInUse       (NERR_BASE+243) /* This device is already in use as a communication device. */
     235
     236        #define NERR_InvalidComputer   (NERR_BASE+251) /* This computername is invalid. */
     237        #define NERR_MaxLenExceeded    (NERR_BASE+254) /* The string and prefix specified are too long. */
     238        #define NERR_BadComponent      (NERR_BASE+256) /* This path component is invalid. */
     239        #define NERR_CantType          (NERR_BASE+257) /* Cannot determine type of input. */
     240        #define NERR_TooManyEntries    (NERR_BASE+262) /* The buffer for types is not big enough. */
     241
     242        #define NERR_LogOverflow           (NERR_BASE+277)      /* This log file exceeds the maximum defined size. */
     243        #define NERR_LogFileChanged        (NERR_BASE+278)      /* This log file has changed between reads. */
     244        #define NERR_LogFileCorrupt        (NERR_BASE+279)      /* This log file is corrupt. */
     245
     246        #define NERR_SourceIsDir   (NERR_BASE+280) /* The source path cannot be a directory. */
     247        #define NERR_BadSource     (NERR_BASE+281) /* The source path is illegal. */
     248        #define NERR_BadDest       (NERR_BASE+282) /* The destination path is illegal. */
     249        #define NERR_DifferentServers   (NERR_BASE+283) /* The source and destination paths are on different servers. */
     250        #define NERR_RunSrvPaused       (NERR_BASE+285) /* The Run server you requested is paused. */
     251        #define NERR_ErrCommRunSrv      (NERR_BASE+289) /* An error occurred when communicating with a Run server. */
     252        #define NERR_ErrorExecingGhost  (NERR_BASE+291) /* An error occurred when starting a background process. */
     253        #define NERR_ShareNotFound      (NERR_BASE+292) /* The shared resource you are connected to could not be found.*/
     254
     255        #define NERR_InvalidLana        (NERR_BASE+300) /* The LAN adapter number is invalid.  */
     256        #define NERR_OpenFiles          (NERR_BASE+301) /* There are open files on the connection.    */
     257        #define NERR_ActiveConns        (NERR_BASE+302) /* Active connections still exist. */
     258        #define NERR_BadPasswordCore    (NERR_BASE+303) /* This netname or password is invalid. */
     259        #define NERR_DevInUse           (NERR_BASE+304) /* The device is being accessed by an active process. */
     260        #define NERR_LocalDrive         (NERR_BASE+305) /* The drive letter is in use locally. */
     261        #define NERR_PausedConns        (NERR_BASE+306) /* Paused devices cannot be deleted */
     262        #define NERR_PipeBufTooSmall    (NERR_BASE+307) /* Write to a network named pipe buffer that is too small */
     263
     264        #define NERR_AlertExists        (NERR_BASE+330) /* The specified client is already registered for the specified event. */
     265        #define NERR_TooManyAlerts      (NERR_BASE+331) /* The alert table is full. */
     266        #define NERR_NoSuchAlert        (NERR_BASE+332) /* An invalid or nonexistent alertname was raised. */
     267        #define NERR_BadRecipient       (NERR_BASE+333) /* The alert recipient is invalid.*/
     268        #define NERR_AcctLimitExceeded  (NERR_BASE+334) /* A user's session with this server has been deleted
     269                                                         * because his logon hours are no longer valid */
     270        #define NERR_InvalidLogSeek     (NERR_BASE+340) /* The log file does not contain the requested record number. */
     271
     272        #define NERR_ParmsMoved         (NERR_BASE+345) /* The parameters in the %1 section have been moved to the %2 section in the %3 file. */
     273
     274        #define NERR_BadUasConfig       (NERR_BASE+350) /* The user account system database is not configured correctly. */
     275        #define NERR_InvalidUASOp       (NERR_BASE+351) /* This operation is not permitted when the Netlogon service is running. */
     276        #define NERR_LastAdmin          (NERR_BASE+352) /* This operation is not allowed on the last admin account. */
     277        #define NERR_DCNotFound         (NERR_BASE+353) /* Unable to find domain controller for this domain. */
     278        #define NERR_LogonTrackingError (NERR_BASE+354) /* Unable to set logon information for this user. */
     279        #define NERR_NetlogonNotStarted (NERR_BASE+355) /* The Netlogon service has not been started. */
     280        #define NERR_CanNotGrowUASFile  (NERR_BASE+356) /* Unable to grow the user account system database. */
     281        #define NERR_PasswordMismatch   (NERR_BASE+358) /* A password mismatch has been detected. */
     282
     283        #define NERR_MaxBadPasswordExceeded (NERR_BASE+359) /* The number of bad password has exceeded the max allowed */
     284
     285        #define NERR_NoSuchServer       (NERR_BASE+360) /* The server ID does not specify a valid server. */
     286        #define NERR_NoSuchSession      (NERR_BASE+361) /* The session ID does not specify a valid session. */
     287        #define NERR_NoSuchConnection   (NERR_BASE+362) /* The connection ID does not specify a valid connection. */
     288        #define NERR_TooManyServers     (NERR_BASE+363) /* There is no space for another entry in the table of available servers. */
     289        #define NERR_TooManySessions    (NERR_BASE+364) /* The server has reached the maximum number of sessions it supports. */
     290        #define NERR_TooManyConnections (NERR_BASE+365) /* The server has reached the maximum number of connections it supports. */
     291        #define NERR_TooManyFiles       (NERR_BASE+366) /* The server cannot open more files because it has reached its maximum number. */
     292        #define NERR_NoAlternateServers (NERR_BASE+367) /* There are no alternate servers registered on this server. */
     293        #define NERR_TooManySrvNames    (NERR_BASE+368) /* The maximum number of server names has been reached. */
     294        #define NERR_DelPrimaryName     (NERR_BASE+369) /* The deletion of the server's primary name is not allowed. */
     295
     296        #define NERR_BadDosRetCode      (NERR_BASE+400) /* The program below returned an MS-DOS error code:*/
     297        #define NERR_ProgNeedsExtraMem  (NERR_BASE+401) /* The program below needs more memory:*/
     298        #define NERR_BadDosFunction     (NERR_BASE+402) /* The program below called an unsupported MS-DOS function:*/
     299        #define NERR_RemoteBootFailed   (NERR_BASE+403) /* The workstation failed to boot.*/
     300        #define NERR_BadFileCheckSum    (NERR_BASE+404) /* The file below is corrupt.*/
     301        #define NERR_NoRplBootSystem    (NERR_BASE+405) /* No loader is specified in the boot-block definition file.*/
     302        #define NERR_RplLoadrNetBiosErr (NERR_BASE+406) /* NetBIOS returned an error: The NCB and SMB are dumped above.*/
     303        #define NERR_RplLoadrDiskErr    (NERR_BASE+407) /* A disk I/O error occurred.*/
     304        #define NERR_ImageParamErr      (NERR_BASE+408) /* Image parameter substitution failed.*/
     305        #define NERR_TooManyImageParams (NERR_BASE+409) /* Too many image parameters cross disk sector boundaries.*/
     306        #define NERR_NonDosFloppyUsed   (NERR_BASE+410) /* The image was not generated from an MS-DOS diskette formatted with /S.*/
     307        #define NERR_RplBootRestart     (NERR_BASE+411) /* Remote boot will be restarted later.*/
     308        #define NERR_RplSrvrCallFailed  (NERR_BASE+412) /* The call to the Remoteboot server failed.*/
     309        #define NERR_CantConnectRplSrvr (NERR_BASE+413) /* Cannot connect to the Remoteboot server.*/
     310        #define NERR_CantOpenImageFile  (NERR_BASE+414) /* Cannot open image file on the Remoteboot server.*/
     311        #define NERR_CallingRplSrvr     (NERR_BASE+415) /* Connecting to the Remoteboot server...*/
     312        #define NERR_StartingRplBoot    (NERR_BASE+416) /* Connecting to the Remoteboot server...*/
     313        #define NERR_RplBootServiceTerm (NERR_BASE+417) /* Remote boot service was stopped; check the error log for the cause of the problem.*/
     314        #define NERR_RplBootStartFailed (NERR_BASE+418) /* Remote boot startup failed; check the error log for the cause of the problem.*/
     315        #define NERR_RPL_CONNECTED      (NERR_BASE+419) /* A second connection to a Remoteboot resource is not allowed.*/
     316        #define NERR_RplBootErrDetected (NERR_BASE+420) /* The REMOTEBOOT service detected a configuration error but is continuing.  Check the error log at the remote IPL server for details. */
     317        #define NERR_RPL_COPYRIGHT1     (NERR_BASE+421) /* Remote IPL Initialization Program Version 2.0. */
     318        #define NERR_RPL_COPYRIGHT2     (NERR_BASE+422) /* (C) Copyright International Business Machines Corporation 1989, 1991. */
     319        #define NERR_RPL_COPYRIGHT3     (NERR_BASE+423) /* (C) Copyright Microsoft Corporation 1989, 1991. */
     320
     321        #define NERR_FTNotInstalled     (NERR_BASE+425) /* DISKFT.SYS is not installed. */
     322        #define NERR_FTMONITNotRunning  (NERR_BASE+426) /* FTMONIT is not running */
     323        #define NERR_FTDiskNotLocked    (NERR_BASE+427) /* FTADMIN has not locked the disk. */
     324        #define NERR_FTDiskNotAvailable (NERR_BASE+428) /* Some other process has locked the disk. */
     325        #define NERR_FTUnableToStart    (NERR_BASE+429) /* The verifier/correcter cannot be started. */
     326        #define NERR_FTNotInProgress    (NERR_BASE+430) /* The verifier/correcter can't be aborted because it isn't started. */
     327        #define NERR_FTUnableToAbort    (NERR_BASE+431) /* The verifier/correcter can't be aborted. */
     328        #define NERR_FTUnabletoChange   (NERR_BASE+432) /* The disk could not be locked/unlocked. */
     329        #define NERR_FTInvalidErrHandle (NERR_BASE+433) /* The error handle was not recognized. */
     330        #define NERR_FTDriveNotMirrored (NERR_BASE+434) /* The drive is not mirrored. */
     331
     332        #if !defined(NERR_AppParmNotFound)
     333        #define NERR_AppParmNotFound            (NERR_BASE+435)
     334        #endif
     335        #if !defined(NERR_AppParmExists)
     336        #define NERR_AppParmExists              (NERR_BASE+436)
     337        #endif
     338        #if !defined(NERR_UserCannotOverride)
     339        #define NERR_UserCannotOverride         (NERR_BASE+437)
     340        #endif
     341        #if !defined(NERR_EnvDataMustBeString)
     342        #define NERR_EnvDataMustBeString        (NERR_BASE+438)
     343        #endif
     344        #if !defined(NERR_IniFileError)
     345        #define NERR_IniFileError               (NERR_BASE+439)
     346        #endif
     347        #if !defined(NERR_IniFileOnlyOnPrimary)
     348        #define NERR_IniFileOnlyOnPrimary       (NERR_BASE+440)
     349        #endif
     350        #if !defined(NERR_IniMissingOrDamaged)
     351        #define NERR_IniMissingOrDamaged        (NERR_BASE+441)
     352        #endif
     353        #if !defined(NERR_IncorrectApptype)
     354        #define NERR_IncorrectApptype           (NERR_BASE+442)
     355        #endif
     356
     357        #define NERR_NoAccessDrive      (NERR_BASE+681)
     358        #if !defined(NERR_AliasExists)
     359        #define NERR_AliasExists        (NERR_BASE+682)
     360        #endif
     361        #if !defined(NERR_AliasNotFound)
     362        #define NERR_AliasNotFound      (NERR_BASE+683)
     363        #endif
     364        #define NERR_InvAliasDev        (NERR_BASE+685)
     365        #if !defined(NERR_DCDBError)
     366        #define NERR_DCDBError          (NERR_BASE+686)
     367        #endif
     368        #if !defined(NERR_NetnameExists)
     369        #define NERR_NetnameExists      (NERR_BASE+687)
     370        #endif
     371        #if !defined(NERR_DupAliasRes)
     372        #define NERR_DupAliasRes       (NERR_BASE+688)
     373        #endif
     374
     375        #if !defined(NERR_AppExists)
     376        #define NERR_AppExists          (NERR_BASE+692)
     377        #endif
     378        #if !defined(NERR_AppNotFound)
     379        #define NERR_AppNotFound        (NERR_BASE+693)
     380        #endif
     381        #if !defined(NERR_DCDBCreateError)
     382        #define NERR_DCDBCreateError    (NERR_BASE+694)
     383        #endif
     384        #if !defined(NERR_NotPrimaryDCDB)
     385        #define NERR_NotPrimaryDCDB     (NERR_BASE+695)
     386        #endif
     387        #define NERR_BadAppRemark       (NERR_BASE+696)
     388        #define NERR_CannotMigrate      (NERR_BASE+697)
     389
     390        #define NERR_ApplyNotPermitted  (NERR_BASE+700)
     391        #define NERR_IncompleteApply    (NERR_BASE+701)
     392        #define NERR_ApplyFailed        (NERR_BASE+702)
     393
     394    #endif
     395
    34396    #ifndef SNLEN
    35397        #define CNLEN           15                  /* Computer name length     */
  • trunk/include/helpers/procstat.h

    r240 r257  
    234234
    235235    // #pragma pack(1)
    236     #pragma pack(4)         // V0.9.10 (2001-04-08) [umoeller]
    237236
    238237    #define QS32_PROCESS      0x0001
  • trunk/include/helpers/textview.h

    r206 r257  
    449449    #define XS_VSCROLL          0x0001      // show vertical scroll bar
    450450    #define XS_HSCROLL          0x0002      // show horizontal scroll bar
    451     #define XS_AUTOVHIDE        0x0004      // with XTXF_VSCROLL: automatically hide scrollbar
    452     #define XS_AUTOHHIDE        0x0008      // with XTXF_HSCROLL: automatically hide scrollbar
     451    #define XS_AUTOVHIDE        0x0004      // with XS_VSCROLL: automatically hide scrollbar
     452    #define XS_AUTOHHIDE        0x0008      // with XS_HSCROLL: automatically hide scrollbar
    453453
    454454    // handy macro V0.9.20 (2002-08-10) [umoeller]
  • trunk/include/helpers/tree.h

    r174 r257  
    1010#endif
    1111
    12 #ifndef XWPTREE_INCLUDED               //  Allow multiple inclusions
     12#ifndef XWPTREE_INCLUDED
    1313    #define XWPTREE_INCLUDED
    1414
  • trunk/include/helpers/xwpsecty.h

    r241 r257  
    7070 *      real ACLs which are unlimited in size per resource.
    7171 *
    72  *      To implement this efficiently, XWPSec uses "subject handles", which
    73  *      is a concept borrowed from SES. However, XWPSec does not use the
    74  *      SES APIs for creating and managing those, but implements this
    75  *      functionality itself.
     72 *      To implement this efficiently, XWPSec uses "subject handles",
     73 *      which is a concept borrowed from SES. However, XWPSec does not
     74 *      use the SES APIs for creating and managing those, but implements
     75 *      this functionality itself.
    7676 *
    7777 *      For authorizing events, XWPSec uses the XWPSUBJECTINFO and
    7878 *      XWPSECURITYCONTEXT structures, plus an array of RESOURCEACL
    79  *      structs which forms the global system ACL table shared with
     79 *      structs that forms the global system ACL table shared with
    8080 *      the ring-0 device driver.
    8181 *
     
    8787 *      users. However, one user logon is special and is called
    8888 *      the "local" logon: that user owns the shell, most
    89  *      importantly the Workplace Shell, and processes started
    90  *      via the shell run on behalf of that user.
     89 *      importantly PM and the Workplace Shell, and processes
     90 *      started via the shell run on behalf of that user.
    9191 *
    9292 *      When a user logs on, XWPShell authenticates the credentials
     
    222222    typedef unsigned long HXSUBJECT;
    223223
    224     typedef unsigned long XWPSECID;
     224    typedef long XWPSECID;
    225225
    226226    /*
     
    303303
    304304    /*
    305      *@@ XWPSECURITYCONTEXT:
     305     *@@ XWPSECURITYCONTEXTCORE:
    306306     *      describes the security context for a process.
    307307     *
     
    345345     *          there would be one subject handle representing the
    346346     *          ACLs for that in addition to those of the user running
    347      *          it.
     347     *          it (if any).
    348348     *
    349349     *      --  For processes that were started during system startup,
     
    352352     *          PIDs to the driver with the "initialization" ring-0 API.
    353353     *          As a result, all processes started through CONFIG.SYS
    354      *          are considered trusted processes.
    355      */
    356 
    357     typedef struct _XWPSECURITYCONTEXT
    358     {
    359         ULONG       cbStruct;
    360         ULONG       ulPID;          // process ID
    361 
    362         ULONG       cSubjects;      // no. of subject handles in this context
     354     *          are presently considered trusted processes.
     355     */
     356
     357    typedef struct _XWPSECURITYCONTEXTCORE
     358    {
     359        USHORT      pidParent;      // ID of process parent
     360
     361        USHORT      cSubjects;      // no. of subject handles in this context
    363362
    364363        HXSUBJECT   aSubjects[1];   // array of cSubjects subject handles,
    365                                         // determining the permissions of this
    366                                         // process
    367 
    368     } XWPSECURITYCONTEXT, *PXWPSECURITYCONTEXT;
     364                                    // determining the permissions of this
     365                                    // process
     366
     367    } XWPSECURITYCONTEXTCORE, *PXWPSECURITYCONTEXTCORE;
    369368
    370369    /* ******************************************************************
     
    426425                    // is required for that).
    427426                    // Should be used together with "Read", because
    428                     // "Write" alone doesn't make much sense.
     427                    // "Write" alone is not terribly useful.
    429428                    // Besides, "Attrib" permission will also be
    430429                    // required.
     
    460459    /*
    461460     *@@ XWPSECSTATUS:
     461     *      structure representing the current status of XWPSec.
     462     *      Used with QUECMD_QUERYSTATUS.
    462463     *
    463464     *@@added V1.0.1 (2003-01-10) [umoeller]
     
    470471        // the following fields are only set if fLocalSecurity is TRUE
    471472
    472         ULONG       cbAllocated;        // fixed memory currently allocated in ring 0
     473        ULONG       cbAllocated;        // total fixed memory currently allocated in ring 0
    473474        ULONG       cAllocations,       // no. of allocations made since startup
    474475                    cFrees;             // no. of frees made since startup
     
    478479        ULONG       cGranted,           // no. of syscalls where access was granted
    479480                    cDenied;            // ... and denied
     481        LONG        cContexts;          // no. of currently allocated security contexts
     482                                        // (always >= the no. of running processes)
     483        ULONG       cbACLs;             // of cbAllocated, no. of bytes in use for ACLs
    480484    } XWPSECSTATUS, *PXWPSECSTATUS;
    481 
    482485
    483486    /* ******************************************************************
     
    507510    typedef struct _XWPUSERINFO
    508511    {
    509         XWPSECID    uid;                // user's ID (unique); 0 for root
     512        XWPSECID    uid;                    // user's ID (unique); 0 for root
    510513        CHAR        szUserName[XWPSEC_NAMELEN];
    511514        CHAR        szFullName[XWPSEC_FULLNAMELEN];       // user's clear name
     515        CHAR        szUserShell[CCHMAXPATH];    // user shell (normally "X:\OS2\PMSHELL.EXE")
    512516    } XWPUSERINFO, *PXWPUSERINFO;
    513517
     
    557561        XWPSECID    uid;            // user's ID
    558562        CHAR        szUserName[XWPSEC_NAMELEN];
    559         ULONG       cSubjects;      // no. of entries in aSubjects array
     563        USHORT      cSubjects;      // no. of entries in aSubjects array
    560564        HXSUBJECT   aSubjects[1];   // array of subject handles of this user; one "0" entry if root
    561565    } XWPLOGGEDON, *PXWPLOGGEDON;
     
    601605
    602606    #define XWPSEC_DB_ACL_SYNTAX        (ERROR_XWPSEC_FIRST + 40)
    603     #define XWPSEC_DB_ACL_DUPRES        (ERROR_XWPSEC_FIRST + 41)
     607    #define XWPSEC_DB_ACL_INTEGRITY     (ERROR_XWPSEC_FIRST + 41)
     608    #define XWPSEC_DB_ACL_DUPRES        (ERROR_XWPSEC_FIRST + 42)
    604609                // more than one line for the same resource in ACL DB
    605610
     
    745750        } QueryGroups;
    746751
    747         #define QUECMD_QUERYPROCESSOWNER            5
     752        #define QUECMD_QUERYUSERNAME                5
     753
     754        struct
     755        {
     756            XWPSECID    uid;                            // in: user ID
     757            CHAR        szUserName[XWPSEC_NAMELEN];     // out: user name
     758        } QueryUserName;
     759
     760        #define QUECMD_QUERYPROCESSOWNER            6
    748761            // return the uid of the user who owns
    749762            // the given process.
    750             // Required authority: administrator.
     763            // Required authority: XWPPERM_QUERYUSERINFO,
     764            // unless the given process is owned by the
     765            // same user who runs the query.
    751766        struct
    752767        {
    753             ULONG               ulPID;      // in: PID to query
     768            USHORT              pid;        // in: PID to query (or 0 for calling process)
     769            HXSUBJECT           hsubj0;     // out: hSubject of user (or privileged process)
    754770            XWPSECID            uid;        // out: uid of owner, if NO_ERROR is returned
    755771        } QueryProcessOwner;
    756772
    757         #define QUECMD_CREATEUSER                   6
     773        #define QUECMD_CREATEUSER                   7
    758774
    759775        struct
     
    765781        } CreateUser;
    766782
    767         #define QUECMD_SETUSERDATA                  7
     783        #define QUECMD_SETUSERDATA                  8
    768784
    769785        XWPUSERINFO     SetUserData;
    770786
    771         #define QUECMD_DELETEUSER                   8
     787        #define QUECMD_DELETEUSER                   9
    772788
    773789        XWPSECID        uidDelete;
    774790
    775         #define QUECMD_QUERYPERMISSIONS             9
     791        #define QUECMD_QUERYPERMISSIONS             10
    776792
    777793        struct
     
    781797        } QueryPermissions;
    782798
     799        #define QUECMD_SWITCHUSER                   11
     800            // change the credentials of the current process. This
     801            // allows a process to run on behalf of a different user
     802            // and can be used to implement a "su" command, since
     803            // processes started by the current process will inherit
     804            // those credentials.
     805
     806        struct
     807        {
     808            CHAR        szUserName[XWPSEC_NAMELEN];
     809            CHAR        szPassword[XWPSEC_NAMELEN];
     810            XWPSECID    uid;                        // out: user id if NO_ERROR
     811        } SwitchUser;
     812
    783813    } QUEUEUNION, *PQUEUEUNION;
    784814
     
    836866    /* ******************************************************************
    837867     *
    838      *   Ring-0 (driver) APIs
     868     *   APIs for interfacing XWPShell
    839869     *
    840870     ********************************************************************/
    841871
    842     /*
    843      *      Ring 0 interfaces required to be called from XWPShell:
    844      *
    845      *      --  Initialization: to be called exactly once when
    846      *          XWPShell starts up. This call enables local security
    847      *          and switches the driver into authorization mode:
    848      *          from then on, all system events are authenticated
    849      *          via the KPI callouts.
    850      *
    851      *          With this call, XWPShell must pass down an array of
    852      *          PIDs that were already running when XWPShell was
    853      *          started, including XWPShell itself. For these
    854      *          processes, the driver will create security contexts
    855      *          as trusted processes.
    856      *
    857      *          In addition, XWPShell sends down an array with all
    858      *          definitions of trusted processes so that the driver
    859      *          can create special security contexts for those.
    860      *
    861      *      --  Query security context: XWPShell needs to be able
    862      *          to retrieve the security context of a given PID
    863      *          from the driver to be able to authorize ring-3 API
    864      *          calls such as "create user" or changing permissions.
    865      *
    866      *      --  Set security context: changes the security context
    867      *          of an existing process. This is used by XWPShell
    868      *          to change its own context when the local user logs
    869      *          on. In addition, XWPShell will call this when a
    870      *          third party process has requested to change its
    871      *          context and this request was authenticated.
    872      *
    873      *      --  ACL table: Whenever subject handles are created or
    874      *          deleted, XWPShell needs to rebuild the system ACL
    875      *          table to contain the fresh subject handles and
    876      *          pass them all down to the driver.
    877      *
    878      *      --  Refresh process list: XWPShell needs to periodically
    879      *          call into the driver to pass it a list of processes
    880      *          that are currently running. Since there is no callout
    881      *          for when a process has terminated, the driver will
    882      *          end up with plenty of zombie PIDs after a while. This
    883      *          call will also be necessary before a user logs off
    884      *          after his processes have been terminated to make
    885      *          sure that subject handles are no longer in use.
    886      */
    887 
    888     /*
    889      *@@ ACCESS:
    890      *
    891      *@@added V1.0.1 (2003-01-05) [umoeller]
    892      */
    893 
    894     typedef struct _ACCESS
    895     {
    896         HXSUBJECT   hSubject;           // subject handle; this is -1 if an entry
    897                                         // exists for this resource but the user or
    898                                         // group is not currently in use (because no
    899                                         // such user is logged on)
    900         BYTE        fbAccess;           // XWPACCESS_* flags
    901     } ACCESS, *PACCESS;
    902 
    903     /*
    904      *@@ RESOURCEACL:
    905      *      definition of a resource entry in the system access control
    906      *      list (ACL).
    907      *
    908      *      At ring 0, the driver has a list of all RESOURCEACL entries
    909      *      defined for the system. Each entry in turn has an array of
    910      *      ACCESS structs listing the subject handles for the resource,
    911      *      for example, defining that subject handle 1 (which could be
    912      *      representing a user) may read and write this resource, subject
    913      *      handle 2 (representing one of the groups the user belongs to)
    914      *      may execute, and so on.
    915      *
    916      *      There will only be one entry for any resource per subject.
    917      *      As a result, if the permissions for a resource are changed,
    918      *      the existing entry must be found and refreshed to avoid
    919      *      duplicates.
    920      *
    921      *      The global ACL table is build by XWPShell whenever it needs
    922      *      updating and passed down to the driver for future use. It
    923      *      will need rebuilding whenever a subject handle gets created
    924      *      or when access permissions are changed by an administrator.
    925      *
    926      *      The table will be build as follows by XWPShell:
    927      *
    928      *      1)  XWPShell loads the file defining the ACLs for the entire
    929      *          system.
    930      *
    931      *          For each definition in the file, it builds a RESOURCEACL
    932      *          entry. It checks the permissions defined for the resource
    933      *          in the file and sets up the array of ACCESS structures for
    934      *          the resource. If a permission was defined for a user for
    935      *          which a subject handle already exists (because the user
    936      *          is already logged on), that subject handle is stored.
    937      *          If a definition exists but none of the permissions apply
    938      *          to any of the current users (because those users are not
    939      *          logged on, or the groups are not in use yet), a dummy
    940      *          entry with a -1 subject handle is created to block access
    941      *          to the resource (see the algorithm description below).
    942      *
    943      *      2)  XWPShell then sends the system ACL list down to the driver.
    944      *
    945      *      During authorization, for any event, the driver first checks
    946      *      if a null ("root") subject handle exists in the process's
    947      *      security context. If so, access is granted unconditionally.
    948      *
    949      *      Otherwise, ACLs apply to all subdirectories too, unless a more
    950      *      specific ACL entry is encountered. In other words,
    951      *      the driver authorizes events bottom-up in the following order:
    952      *
    953      *      1)  It checks for whether an ACL entry for the given resource
    954      *          exists in the ACL table.
    955      *
    956      *          If any ACL entry was found for the resource, access is
    957      *          granted if any ACL entry allowed access for one of the
    958      *          subjects in the process's security context. Access is denied
    959      *          if ACL entries existed for the resource but none allowed access,
    960      *          which includes the "blocker" -1 entry described above.
    961      *
    962      *          In any case, the search stops if an ACL entry was found
    963      *          in the table, and access is either granted or denied.
    964      *
    965      *      2)  Only if no entry was found for the resource in any of the
    966      *          subject infos, we climb up to the parent directory and
    967      *          search all subject infos again. Go back to (1).
    968      *
    969      *      3)  After the root directory has been processed and still no
    970      *          entry exists, access is denied.
    971      *
    972      *      Examples:
    973      *
    974      *      User "dumbo" belongs to the groups "users" and "admins".
    975      *      The following ACLs are defined:
    976      *
    977      *      --  "users" may read "C:\DIR",
    978      *
    979      *      --  "admins" may read and write "C:\",
    980      *
    981      *      --  "admins" may create directories in "C:\DIR",
    982      *
    983      *      --  "otheruser" may read "C:\OTHERDIR".
    984      *
    985      *      Assuming that only "dumbo" is logged on presently and the following
    986      *      subject handles have thus been created:
    987      *
    988      *      --  1 for user "dumbo",
    989      *
    990      *      --  2 for group "users",
    991      *
    992      *      --  3 for group "admins",
    993      *
    994      *      the system ACL table will contain the following entries:
    995      *
    996      *      --  "C:\": 3 (group "admins") may read and write;
    997      *
    998      *      --  "C:\DIR": 2 (group "users") may read, 3 (group "admins) may
    999      *          create directories;
    1000      *
    1001      *      --  "C:\OTHERDIR": this will have a dummy -1 entry with no permissions
    1002      *          because the only ACL defined is that user "otheruser" may read, and
    1003      *          that user is not logged on.
    1004      *
    1005      *      1)  Assume a process running on behalf of "dumbo" wants to open
    1006      *          C:\DIR\SUBDIR\TEXT.DOC for reading.
    1007      *          Since the security context of "dumbo" has the three subject
    1008      *          handles for user "dumbo" (1) and the groups "users" (2) and
    1009      *          "admins" (3), the following happens:
    1010      *
    1011      *          a)  We check the system ACL table for "C:\DIR\SUBDIR\TEXT.DOC"
    1012      *              and find no ACL entry.
    1013      *
    1014      *          b)  So we take the parent directory, "C:\DIR\SUBDIR",
    1015      *              and again we find nothing.
    1016      *
    1017      *          c)  Taking the next parent, "C:\DIR\", we find the above two
    1018      *              subject handles: since "users" (2) may read, and that is
    1019      *              part of the security context, we grant access.
    1020      *
    1021      *      2)  Now assume that the same process wants to write the file back:
    1022      *
    1023      *          a)  Again, we find no ACL entries for "C:\DIR\SUBDIR\TEXT.DOC"
    1024      *              or "C:\DIR\SUBDIR".
    1025      *
    1026      *          b)  Searching for "C:\DIR", we find that "users" (2) may only read,
    1027      +              but not write. Also, "admins" (3) may create directories under
    1028      *              "C:\DIR", which is not sufficient either. Since no other entries
    1029      *              exist for "C:\DIR"  that would permit write, we deny access.
    1030      *              That "admins" may write to "C:\" does not help since more
    1031      *              specific entries exist for "C:\DIR".
    1032      *
    1033      *      3)  Now assume that the same process wants to create a new directory
    1034      *          under "C:\DIR\SUBDIR".
    1035      *
    1036      *          a)  Again, we find no ACL entries for "C:\DIR\SUBDIR".
    1037      *
    1038      *          b)  Searching for "C:\DIR", we find that "users" may only read,
    1039      *              which does not help. However, "admins" may create directories,
    1040      *              so we grant access.
    1041      *
    1042      *      4)  Assume now that the process wants to create a new directory under
    1043      *          "C:\OTHERDIR".
    1044      *
    1045      *          We find the ACL entry for "C:\OTHERDIR" and see only the -1
    1046      *          subject handle (for user "otheruser", who's not logged on),
    1047      *          and since no other permissions are set for us, we deny access.
    1048      *
    1049      *@@added V1.0.1 (2003-01-05) [umoeller]
    1050      */
    1051 
    1052     typedef struct _RESOURCEACL
    1053     {
    1054         ULONG       cbStruct;           // size of entire structure; this is
    1055                                         //   sizeof(RESOURCEACL)
    1056                                         // + cbName - 1
    1057                                         // + cAccesses * sizeof(ACCESS)
    1058         USHORT      cAccesses;          // no. of entries in array of ACCESS structs;
    1059                                         // this comes right after szName, so its address
    1060                                         // is szName + cbName
    1061         USHORT      cbName;             // offset of array of ACCESS structs after szName
    1062                                         // (includes null terminator and DWORD alignment
    1063                                         // filler bytes)
    1064         CHAR        szName[1];          // fully qualified filename of this resource
    1065                                         // (zero-terminated)
    1066     } RESOURCEACL, *PRESOURCEACL;
    1067 
    1068     /*
    1069      *@@ RING0BUF:
    1070      *
    1071      *@@added V1.0.1 (2003-01-05) [umoeller]
    1072      */
    1073 
    1074     typedef struct _RING0BUF
    1075     {
    1076         ULONG       cbTotal;
    1077         ULONG       cSubjectInfos;      // no. of subject infos (directly after this struct)
    1078         ULONG       cACLs;              // no. of RESOURCEACL structs (after subject infos)
    1079         ULONG       ofsACLs;            // ofs of first RESOURCEACL struct from beginning of
    1080                                         // RING0BUF
    1081     } RING0BUF, *PRING0BUF;
     872    APIRET xsecQueryStatus(PXWPSECSTATUS pStatus);
     873
     874    APIRET xsecQueryLocalUser(PXWPUSERDBENTRY *ppLocalUser);
     875
     876    APIRET xsecQueryAllUsers(PULONG pcUsers,
     877                             PXWPUSERDBENTRY *ppaUsers);
     878
     879    APIRET xsecQueryGroups(PULONG pcGroups,
     880                           PXWPGROUPDBENTRY *ppaGroups);
     881
     882    APIRET xsecQueryUserName(XWPSECID uid,
     883                             PSZ pszUserName);
     884
     885    APIRET xsecQueryProcessOwner(USHORT pid,
     886                                 XWPSECID *puid);
     887
     888    APIRET xsecCreateUser(PCSZ pcszUserName,
     889                          PCSZ pcszFullName,
     890                          PCSZ pcszPassword,
     891                          XWPSECID gid,
     892                          XWPSECID *puid);
     893
     894    APIRET xsecSetUserData(XWPSECID uid,
     895                           PCSZ pcszUserName,
     896                           PCSZ pcszFullName);
     897
     898    APIRET xsecDeleteUser(XWPSECID uid);
     899
     900    APIRET xsecQueryPermissions(PCSZ pcszFilename,
     901                                PULONG pflAccess);
    1082902
    1083903#endif
Note: See TracChangeset for help on using the changeset viewer.