Changeset 257


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
Files:
1 added
14 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
  • trunk/src/helpers/dialog.c

    r235 r257  
    296296 *      the control _sizes_, and everything is layed out automatically.
    297297 *      You may even have the formatter compute the sizes automatically
    298  *      based on the control classes and values; it is possible to
    299  *      create dialogs without specifying a single size also.
     298 *      based on the control classes and values (strings); it is possible
     299 *      to create dialogs without specifying a single size also.
    300300 *
    301301 *      There are several tricks to how this works.
     
    314314 *          (which again goes into ProcessRow and ProcessColumn).
    315315 *          There is no limit to how deep tables may nest, except
    316  *          the stack size of the current thread. ;-)
     316 *          for the stack size of the current thread, of course.
    317317 *
    318318 *      3)  This whole recursive iteration is performed several times.
  • trunk/src/helpers/dosh.c

    r253 r257  
    25882588 *@@changed V0.9.16 (2001-12-18) [umoeller]: fixed error codes
    25892589 *@@changed V1.0.1 (2003-01-10) [umoeller]: now allowing read for all modes
     2590 *@@changed V1.0.2 (2003-11-13) [umoeller]: optimized; now calling doshQueryPathSize only on failure
    25902591 */
    25912592
     
    26152616            // which isn't that meaningful
    26162617            // V0.9.16 (2001-12-08) [umoeller]
    2617             arc = doshQueryPathSize(pcszFilename,
    2618                                     pcbFile);
     2618            /* arc = doshQueryPathSize(pcszFilename,
     2619                                    pcbFile); */
     2620                // moved this down V1.0.2 (2003-11-13) [umoeller]
    26192621        break;
    26202622
     
    26252627                          | OPEN_ACCESS_READWRITE;
    26262628
    2627             arc = doshQueryPathSize(pcszFilename,
    2628                                     pcbFile);
     2629            /* arc = doshQueryPathSize(pcszFilename,
     2630                                    pcbFile); */
     2631                // moved this down V1.0.2 (2003-11-13) [umoeller]
    26292632        break;
    26302633
     
    26462649    }
    26472650
    2648     if ((!arc) && fsOpenFlags && pcbFile && ppFile)
     2651    if (    (!arc)
     2652         && fsOpenFlags
     2653         && pcbFile
     2654         && ppFile
     2655       )
    26492656    {
    26502657        PXFILE pFile;
     
    26952702                pFile->pszFilename = strdup(pcszFilename);
    26962703            }
    2697             #ifdef DEBUG_DOSOPEN
    26982704            else
    2699                  _Pmpf((__FUNCTION__ ": DosOpen returned %d for %s",
     2705            {
     2706                #ifdef DEBUG_DOSOPEN
     2707                    _Pmpf((__FUNCTION__ ": DosOpen returned %d for %s",
    27002708                             arc, pcszFilename));
    2701             #endif
     2709                #endif
     2710
     2711                // open failed: if the file doesn't exist, DosOpen only
     2712                // returns OPEN_FAILED, while ERROR_FILE_NOT_FOUND would
     2713                // be a bit more informative
     2714                // (this check used to be before DosOpen, but is a bit
     2715                // excessive and should only be run if we really have no open)
     2716                if (arc == ERROR_OPEN_FAILED)
     2717                    arc = doshQueryPathSize(pcszFilename,
     2718                                            pcbFile);
     2719            }
    27022720
    27032721            if (arc)
     
    27502768 *@@added V0.9.13 (2001-06-14) [umoeller]
    27512769 *@@changed V0.9.16 (2001-12-18) [umoeller]: now with XFILE, and always using FILE_BEGIN
    2752  *@@chaanged V0.9.19 (2002-04-02) [umoeller]: added params checking
     2770 *@@changed V0.9.19 (2002-04-02) [umoeller]: added params checking
     2771 *@@changed V1.0.2 (2003-11-13) [umoeller]: optimized cache (using realloc)
    27532772 */
    27542773
     
    28282847            #endif
    28292848
     2849#if 0
    28302850            // free old cache
    28312851            if (pFile->pbCache)
     
    28342854            // allocate new cache
    28352855            if (!(pFile->pbCache = (PBYTE)malloc(pFile->cbCache)))
     2856#else
     2857            // realloc is better V1.0.2 (2003-11-13) [umoeller]
     2858            if (!(pFile->pbCache = (PBYTE)realloc(pFile->pbCache,
     2859                                                  pFile->cbCache)))
     2860#endif
    28362861                arc = ERROR_NOT_ENOUGH_MEMORY;
    28372862            else
     
    44874512
    44884513/*
     4514 *@@ doshMyParentPID:
     4515 *      returns the PID of the parent of the current process.
     4516 *
     4517 *      This uses an interesting hack which is way
     4518 *      faster than DosGetInfoBlocks.
     4519 *
     4520 *@@added V1.0.2 (2003-11-13) [umoeller]
     4521 */
     4522
     4523ULONG doshMyParentPID(VOID)
     4524{
     4525    if (!G_pvLocalInfoSeg)
     4526        // first call:
     4527        GetInfoSegs();
     4528
     4529    // parent PID is at offset 2 in the local info seg
     4530    return *(PUSHORT)((PBYTE)G_pvLocalInfoSeg + 2);
     4531}
     4532
     4533/*
    44894534 *@@ doshMyTID:
    44904535 *      returns the TID of the current thread.
  • trunk/src/helpers/exeh.c

    r242 r257  
    266266
    267267        // read old DOS EXE header
    268         if (!(pExec->pDosExeHeader = (PDOSEXEHEADER)malloc(sizeof(DOSEXEHEADER))))
    269             arc = ERROR_NOT_ENOUGH_MEMORY;
    270         else if (!(arc = doshReadAt(pFile,
    271                                     0,
    272                                     &pExec->cbDosExeHeader,      // in/out
    273                                     (PBYTE)pExec->pDosExeHeader,
    274                                     DRFL_FAILIFLESS)))
     268        if ((arc = doshReadAt(pFile,
     269                              0,
     270                              &pExec->cbDosExeHeader,      // in/out
     271                              (PBYTE)&pExec->DosExeHeader,
     272                              DRFL_FAILIFLESS)))
     273            pExec->cbDosExeHeader = 0;
     274        else
    275275        {
    276276            // now check if we really have a DOS header
    277             if (pExec->pDosExeHeader->usDosExeID != 0x5a4d)
     277            if (pExec->DosExeHeader.usDosExeID != 0x5a4d)
    278278            {
    279279                // arc = ERROR_INVALID_EXE_SIGNATURE;
     
    289289                // remove the DOS header info, since we have none
    290290                // V0.9.12 (2001-05-03) [umoeller]
    291                 FREE(pExec->pDosExeHeader);
     291                // FREE(pExec->pDosExeHeader);
    292292                pExec->cbDosExeHeader = 0;
    293293            }
     
    295295            {
    296296                // we have a DOS header:
    297                 if (pExec->pDosExeHeader->usRelocTableOfs < 0x40)
     297                if (pExec->DosExeHeader.usRelocTableOfs < 0x40)
    298298                {
    299299                    // neither LX nor PE nor NE:
     
    305305                    // we have a new header offset:
    306306                    fLoadNewHeader = TRUE;
    307                     ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     307                    ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    308308                }
    309309            }
     
    11991199        ULONG ulNewHeaderOfs = 0;       // V0.9.12 (2001-05-03) [umoeller]
    12001200
    1201         if (pExec->pDosExeHeader)
     1201        if (pExec->cbDosExeHeader)
    12021202            // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    1203             ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     1203            ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    12041204
    12051205        if (pExec->ulExeFormat == EXEFORMAT_LX)
     
    13531353    HFILE hfExe = pExec->pFile->hf;
    13541354
    1355     if (pExec->pDosExeHeader)
     1355    if (pExec->cbDosExeHeader)
    13561356        // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    1357         ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     1357        ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    13581358
    13591359    ENSURE(DosSetFilePtr(hfExe,
     
    15941594    HFILE hfExe = pExec->pFile->hf;
    15951595
    1596     if (pExec->pDosExeHeader)
     1596    if (pExec->cbDosExeHeader)
    15971597        // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    1598         ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     1598        ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    15991599
    16001600    ENSURE(DosSetFilePtr(hfExe,
     
    18011801        ULONG ulNewHeaderOfs = 0; // V0.9.12 (2001-05-03) [umoeller]
    18021802
    1803         if (pExec->pDosExeHeader)
     1803        if (pExec->cbDosExeHeader)
    18041804            // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    1805             ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     1805            ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    18061806
    18071807        if (pExec->ulExeFormat == EXEFORMAT_LX)
     
    19761976        ULONG           ulNewHeaderOfs = 0; // V0.9.12 (2001-05-03) [umoeller]
    19771977
    1978         if (pExec->pDosExeHeader)
     1978        if (pExec->cbDosExeHeader)
    19791979            // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    1980             ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     1980            ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    19811981
    19821982        if (pExec->ulExeFormat == EXEFORMAT_LX)
     
    23712371        ULONG cb;
    23722372
    2373         if (pExec->pDosExeHeader)
     2373        if (pExec->cbDosExeHeader)
    23742374            // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    2375             ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     2375            ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    23762376
    23772377        // resource table
     
    28832883        ULONG ulPageSize = pExec->pLXHeader->ulPageSize;
    28842884
     2885        // if the data is not compressed, we read it directly
     2886        // into caller's pbData buffer (avoid one memcpy)
     2887        // V1.0.2 (2003-11-13) [umoeller]
     2888        PBYTE pbTarget =
     2889            (ulFlags == VALID) ? pbData : pabCompressed;
     2890
    28852891        ulOffset += ulExeOffset;
    28862892
     
    28982904                                    ulOffset,
    28992905                                    &ulSize,
    2900                                     pabCompressed,
     2906                                    pbTarget, // pabCompressed, V1.0.2 (2003-11-13) [umoeller]
    29012907                                    0)))
    29022908        {
     
    29242930                break;
    29252931
     2932                /* V1.0.2 (2003-11-13) [umoeller]
    29262933                case VALID:
    29272934                    // uncompressed
     
    29302937                           ulPageSize);
    29312938                break;
     2939                */
    29322940            }
    29332941        }
     
    29482956 *      type _and_ ID.
    29492957 *
    2950  *      If NO_ERROR is returned, *ppbResData receives
    2951  *      a new buffer with the raw resource data, and
    2952  *      *pcbResData receives the size of that buffer.
    2953  *      The caller must then free() that buffer.
     2958 *      If NO_ERROR is returned,
     2959 *
     2960 *      --  *ppbResData receives a new buffer with
     2961 *          the raw resource data, which the caller
     2962 *          must free();
     2963 *
     2964 *      --  *pulOffset receives an offset into that
     2965 *          buffer, where the actual resource data
     2966 *          starts;
     2967 *
     2968 *      --  *pcbResData receives the size of the
     2969 *          following resource data (what follows
     2970 *          after *pulOffset).
     2971 *
     2972 *      The reason for this slightly complicated
     2973 *      format is to avoid another memcpy since
     2974 *      resource data need not necessarily be on
     2975 *      an LX page boundary.
    29542976 *
    29552977 *      This code will properly unpack compressed
     
    29772999                          ULONG idResource,      // in: resource ID or 0 for first
    29783000                          PBYTE *ppbResData,     // out: resource data (to be free()'d)
     3001                          PULONG pulOffset,      // out: offset of actual data in buffer
    29793002                          PULONG pcbResData)     // out: size of resource data (ptr can be NULL)
    29803003{
     
    29953018        return ERROR_INVALID_EXE_SIGNATURE;
    29963019
    2997     if (pExec->pDosExeHeader)
     3020    if (pExec->cbDosExeHeader)
    29983021        // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    2999         ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     3022        ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    30003023
    30013024    if (!(cResources = pLXHeader->ulResTblCnt))
     
    31363159                        if (!arc)
    31373160                        {
    3138                             // allocate a new buffer for caller
    3139                             if (!(*ppbResData = (PBYTE)malloc(pRsEntry->cb)))
    3140                                 arc = ERROR_NOT_ENOUGH_MEMORY;
    3141                             else
    3142                             {
    3143                                 // copy into that buffer from the offset
    3144                                 // into the first page and the data from
    3145                                 // the subsequent pages too
    3146                                 memcpy(*ppbResData,
    3147                                        pabUncompressed + ulResOffsetInFirstPage,
    3148                                        pRsEntry->cb);
    3149 
    3150                                 if (pcbResData)
    3151                                     *pcbResData = pRsEntry->cb;
    3152                             }
     3161                            // new code without malloc/memcpy V1.0.2 (2003-11-13) [umoeller]
     3162                            *ppbResData = pabUncompressed;
     3163                            *pulOffset = ulResOffsetInFirstPage;
     3164
     3165
     3166                            /*
     3167                                // allocate a new buffer for caller
     3168                                if (!(*ppbResData = (PBYTE)malloc(pRsEntry->cb)))
     3169                                    arc = ERROR_NOT_ENOUGH_MEMORY;
     3170                                else
     3171                                {
     3172                                    // copy into that buffer from the offset
     3173                                    // into the first page and the data from
     3174                                    // the subsequent pages too
     3175                                    memcpy(*ppbResData,
     3176                                           pabUncompressed + ulResOffsetInFirstPage,
     3177                                           pRsEntry->cb);
     3178                                }
     3179                            */
     3180
     3181                            if (pcbResData)
     3182                                *pcbResData = pRsEntry->cb;
    31533183
    31543184                            fPtrFound = TRUE;
    31553185                        }
    3156 
    3157                         FREE(pabUncompressed);
     3186                        else
     3187                            FREE(pabUncompressed);
     3188
    31583189                        FREE(pabCompressed);
    31593190                    }
     
    32393270        ULONG cb;
    32403271
    3241         if (pExec->pDosExeHeader)
     3272        if (pExec->cbDosExeHeader)
    32423273            // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    3243             ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     3274            ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    32443275
    32453276        // resource table
     
    33513382        return ERROR_INVALID_EXE_SIGNATURE;
    33523383
    3353     if (pExec->pDosExeHeader)
     3384    if (pExec->cbDosExeHeader)
    33543385        // executable has DOS stub: V0.9.12 (2001-05-03) [umoeller]
    3355         ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs;
     3386        ulNewHeaderOfs = pExec->DosExeHeader.ulNewHeaderOfs;
    33563387
    33573388    // _Pmpf((__FUNCTION__ ": entering, checking %d resources", pNEHeader->usResSegmCount));
     
    34543485        char **papsz[] =
    34553486            {
    3456                 (char**)&pExec->pDosExeHeader,
     3487                // (char**)&pExec->pDosExeHeader,
    34573488                (char**)&pExec->pNEHeader,
    34583489                (char**)&pExec->pLXHeader,
  • trunk/src/helpers/helpers_pre.in

    r249 r257  
    4747$(OUTPUTDIR)\xprf.obj\
    4848$(OUTPUTDIR)\xprf2.obj\
     49$(OUTPUTDIR)\xsecapi.obj\
    4950$(OUTPUTDIR)\xstring.obj
    5051
  • trunk/src/helpers/lan.c

    r229 r257  
    213213 *      queries the given service.
    214214 *
     215 *      If NO_ERROR is returned,
     216 +
     217 +          SERVICEBUF.svci2_status & SERVICE_INSTALL_STATE
     218 +
     219 *      can be queried for the service state, which should
     220 *      be one of the following:
     221 *
     222 *      --  SERVICE_UNINSTALLED: not running. For the
     223 *          REQUESTER service, this is only a theoretical
     224 *          value because without it, NERR_WkstaNotStarted
     225 *          (2138) is returned.
     226 *
     227 *      --  SERVICE_INSTALL_PENDING: start in progress
     228 *
     229 *      --  SERVICE_UNINSTALL_PENDING: stop in progress
     230 *
     231 *      --  SERVICE_INSTALLED: running
     232 *
     233 *      Alternatively, call lanServiceControl with the
     234 *      SERVICE_CTRL_INTERROGATE code, which actually asks the
     235 *      service.
     236 *
     237 *      Returns, among others:
     238 *
     239 *      --  NO_ERROR
     240 *
     241 *      --  NERR_WkstaNotStarted (2138): requester is not
     242 *          running.
     243 *
     244 *      --  NERR_ServiceNotInstalled: requested service is
     245 *          not running.
     246 *
    215247 *@@added V1.0.0 (2002-09-24) [umoeller]
    216248 */
     
    240272 *      must be fully qualified so you cannot
    241273 *      abbreviate "requester" with "req", for
    242  *      example (as valid with the net command).
     274 *      example (as valid with the NET START command).
     275 *
     276 *      The name of the service is found in the IBMLAN.INI file.
     277 *      The executable file name of the service is matched to a
     278 *      corresponding entry in the Services section of the
     279 *      IBMLAN.INI file. Any relative file path name supplied
     280 *      for a service is assumed to be relative to the LAN
     281 *      Server root directory (\IBMLAN).
     282 *
     283 *      #Net32ServiceInstall supports a cmdargs argument, which
     284 *      is presently always passed as NULL with this implementation.
    243285 *
    244286 *      Returns, among others:
     
    277319/*
    278320 *@@ lanServiceControl:
    279  *      queries, pauses, resumes, or stops the given service.
     321 *      queries, pauses, resumes, or stops the given service. This
     322 *      has the functionality of the NET STOP command.
    280323 *
    281324 *      opcode must be one of:
    282325 *
    283326 *      --  SERVICE_CTRL_INTERROGATE (0): interrogate service status.
     327 *          This is similar to running lanServiceGetInfo, except
     328 *          that this one actually asks the service for its status,
     329 *          while lanServiceGetInfo simply dumps the status last
     330 *          posted.
    284331 *
    285332 *      --  SERVICE_CTRL_PAUSE (1): pause service.
  • trunk/src/helpers/nls.c

    r249 r257  
    149149                     ++n)
    150150                    G_afLeadByte[n] = TRUE;
     151
    151152                G_fDBCS = TRUE;
    152153            }
  • trunk/src/helpers/nlscache.c

    r243 r257  
    289289 *      After that, this function implements a fast string
    290290 *      cache for various NLS strings. Compared to the
    291  *      standard method, this has the following advantages:
    292  *
    293  *      -- Memory is only consumed for strings that are actually
    294  *         used. The NLSSTRINGS array had become terribly big,
    295  *         and lots of strings were loaded that were never used.
    296  *
    297  *      -- Program startup should be a bit faster because we don't
    298  *         have to load a thousand strings at startup.
    299  *
    300  *      -- The memory buffer holding the string is probably close
    301  *         to the rest of the heap data that the caller allocated,
    302  *         so this might lead to less memory page fragmentation.
    303  *
    304  *      -- To add a new NLS string, before this mechanism existed,
    305  *         three files had to be changed (and kept in sync): common.h
    306  *         to add a field to the NLSSTRINGS structure, dlgids.h to
    307  *         add the string ID, and xfldrXXX.rc to add the resource.
    308  *         With the new mechanism, there's no need to change common.h
    309  *         any more, so the danger of forgetting something is a bit
    310  *         reduced. Anyway, fewer recompiles are needed (maybe),
    311  *         and sending in patches to the code is a bit easier.
     291 *      standard method of preloading all NLS strings at
     292 *      program startup, this method of on-demand string
     293 *      loading has the following advantages:
     294 *
     295 *      --  Memory is only consumed for strings that are actually
     296 *          used.
     297 *
     298 *      --  Program startup should be a bit faster because we don't
     299 *          have to load a thousand strings at startup.
     300 *
     301 *      --  The memory buffer holding the string is probably close
     302 *          to the rest of the heap data that the caller allocated,
     303 *          so this might lead to less memory page fragmentation.
     304 *          (This is a wild guess though.)
     305 *
     306 *      --  To add a new NLS string, before this mechanism existed,
     307 *          three files had to be changed (and kept in sync): common.h
     308 *          to add a field to the NLSSTRINGS structure, dlgids.h to
     309 *          add the string ID, and xfldrXXX.rc to add the resource.
     310 *          With the new mechanism, there's no need to change common.h
     311 *          any more, so the danger of forgetting something is a bit
     312 *          reduced. Anyway, fewer recompiles are needed (maybe),
     313 *          and sending in patches to the code is a bit easier.
    312314 *
    313315 *      On input, specify a string resouce ID that exists
Note: See TracChangeset for help on using the changeset viewer.