The NetUserModalsSet API sets global modals-related information for all users and groups.
Restrictions
This API can be called from DLS and OS/2 workstations, but DLS workstations can issue this call only to a remote LAN Server workstation. Administrator authority is required to call this API. The Netlogon service cannot be running when this API is called at level 1 with parmnum set to PARMNUM_ALL or MODAL1_PARMNUM_ROLE.
Directory and Security Server Only
Authority is based on ACLs rather than privilege level.
#include <netcons.h> #include <access.h> #include <lsdceerr.h> /* DSS only */ NetUserModalsSet(pszTarget, usLevel, buf, usBuflen, parmnum); /* 16 bit */ Net32UserModalsSet(pszTarget, ulLevel, buf, ulBuflen, parmnum, pStatusbuf); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
sLevel or ulLevel
The following are the possible values for parmnum: ┌─────────────────────────┬─────┬──────────────────────────────────────────────┐
│ SYMBOLIC CONSTANT │ VALU│ COMPONENT │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ PARMNUM_ALL │ 0 │ All elements │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_MIN_LEN │ 1 │ usrmod0_min_passwd_len │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_MAX_AGE │ 2 │ usrmod0_max_passwd_age │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_MIN_AGE │ 3 │ usrmod0_min_passwd_age │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_FORCEOFF │ 4 │ usrmod0_force_logoff │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_HISTLEN │ 5 │ usrmod0_password_hist_len │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL0_PARMNUM_MAX_BADPW│ 6 │ usrmod0_maxbadpw │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL1_PARMNUM_ROLE │ 1 │ usrmod1_role │
├─────────────────────────┼─────┼──────────────────────────────────────────────┤
│ MODAL1_PARMNUM_PRIMARY │ 2 │ usrmod1_primary │
└─────────────────────────┴─────┴──────────────────────────────────────────────┘
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NOT_ENOUGH_MEMORY │ 8 │ Sufficient memory is not available.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NETWORK_ACCESS_DENIED │ 65 │ Network access is denied. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_LEVEL │ 124 │ The ul/usLevel parameter is not valid.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │2102 │TheredirectorNETWKSTA
. 200hasnot │
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_RemoteOnly │ 2106 │ This operation is not supported on │
│ │ │ workstations. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BufTooSmall │ 2123 │ The buffer is too small for fixed- │
│ │ │ length data. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_WkstaNotStarted │ 2138 │ The Requester service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InternalError │ 2140 │ An internal error has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadTransactConfig │ 2141 │ The server is not configured for
│
│ │ │ transactions. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidAPI │ 2142 │ The requested API is not supported on
│
│ │ │ the remote server. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_ACFNotFound │ 2219 │ The NET.ACC file is missing. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_ACFNotLoaded │ 2227 │ The UAS database has not been started.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_ACFFileIOFail │ 2229 │ An error was encountered in accessing
│
│ │ │ the accounts database. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidDatabase │ 2247 │ The UAS database file is damaged.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │ 2351 │ The specified computer name is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidUASOp │ 2451 │ This operation is not permitted when
│
│ │ │ the Netlogon service is running. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_CanNotGrowUASFile │ 2456 │ It is not possible to enlarge the
UAS │
│ │ │ file. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DCEError │ 7500 │ DCE error status returned. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DCEErrorLogged │ 7501 │ DCE error status has been logged.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_AuthTicketExpired │ 7511 │ The user's DCE authorization ticket
│
│ │ │ has expired. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_RegistryNotFound │ 7512 │ Unable to contact the DCE security
│
│ │ │ registry. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions: