Partager via


3.1.4.18 NetrServerSetInfo (Opnum 22)

The NetrServerSetInfo method sets server operating parameters for CIFS and SMB Version 1.0 file servers; it can set them individually or collectively. The information is stored in a way that allows it to remain in effect after the system is reinitialized.<82>

 NET_API_STATUS NetrServerSetInfo(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD Level,
   [in, switch_is(Level)] LPSERVER_INFO ServerInfo,
   [in, out, unique] DWORD* ParmErr
 );

ServerName: An SRVSVC_HANDLE (section 2.2.1.1) pointer that identifies the server. The client MUST map this structure to an RPC binding handle (see [C706] sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.

Level: Specifies the information level of the data. The value of the Level parameter determines the contents of the ServerInfo parameter. This parameter MUST be one of the values in the following table. The NetrServerSetInfo method does not support a Level value of 103. If a Level value of 103 is specified, the server MUST return ERROR_INVALID_LEVEL.

Value

Meaning

101

LPSERVER_INFO_101

102

LPSERVER_INFO_102

502

LPSERVER_INFO_502

503

LPSERVER_INFO_503

599

LPSERVER_INFO_599

1005

LPSERVER_INFO_1005

1107

LPSERVER_INFO_1107

1010

LPSERVER_INFO_1010

1016

LPSERVER_INFO_1016

1017

LPSERVER_INFO_1017

1018

LPSERVER_INFO_1018

1501

LPSERVER_INFO_1501

1502

LPSERVER_INFO_1502

1503

LPSERVER_INFO_1503

1506

LPSERVER_INFO_1506

1510

LPSERVER_INFO_1510

1511

LPSERVER_INFO_1511

1512

LPSERVER_INFO_1512

1513

LPSERVER_INFO_1513

1514

LPSERVER_INFO_1514

1515

LPSERVER_INFO_1515

1516

LPSERVER_INFO_1516

1518

LPSERVER_INFO_1518

1523

LPSERVER_INFO_1523

1528

LPSERVER_INFO_1528

1529

LPSERVER_INFO_1529

1530

LPSERVER_INFO_1530

1533

LPSERVER_INFO_1533

1534

LPSERVER_INFO_1534

1535

LPSERVER_INFO_1535

1536

LPSERVER_INFO_1536

1538

LPSERVER_INFO_1538

1539

LPSERVER_INFO_1539

1540

LPSERVER_INFO_1540

1541

LPSERVER_INFO_1541

1542

LPSERVER_INFO_1542

1543

LPSERVER_INFO_1543

1544

LPSERVER_INFO_1544

1545

LPSERVER_INFO_1545

1546

LPSERVER_INFO_1546

1547

LPSERVER_INFO_1547

1548

LPSERVER_INFO_1548

1549

LPSERVER_INFO_1549

1550

LPSERVER_INFO_1550

1552

LPSERVER_INFO_1552

1553

LPSERVER_INFO_1553

1554

LPSERVER_INFO_1554

1555

LPSERVER_INFO_1555

1556

LPSERVER_INFO_1556

ServerInfo: This is a structure of type LPSERVER_INFO, as specified in section 2.2.3.7. The content of the ServerInfo parameter is determined by the Level parameter, as the preceding table shows.

ParmErr: A pointer to a value that receives the index of the first member of the server information structure that caused an ERROR_INVALID_PARAMETER error code, if it occurs.

Return Values: The method returns 0x00000000 (NERR_Success) to indicate success; otherwise, it returns a nonzero error code. The method can take any specific error code value, as specified in [MS-ERREF] section 2.2. The most common error codes are listed in the following table.

Return value/code

Description

0x00000000

NERR_Success

The client request succeeded.

0x00000005

ERROR_ACCESS_DENIED

Access is denied.

0x0000007C

ERROR_INVALID_LEVEL

The system call level is not correct.

0x00000057

ERROR_INVALID_PARAMETER

The client request failed because the specified parameter is invalid. For details see the description that follows for the ParmErr parameter.

0x00000008

ERROR_NOT_ENOUGH_MEMORY

Not enough storage is available to process this command.

In response to a NetrServerSetInfo request, the server MUST update the ServerConfiguration object based on the caller-supplied values and the Level. The server can set its operating parameters individually or collectively. The information is stored in a way that allows it to remain in effect after the system is reinitialized.

The value of the Level parameter can be 101, 102, 502, 503, 599, 1005, 1107, 1010, 1016, 1017, 1018, 1501, 1502, 1503, 1506, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1518, 1523, 1528, 1529, 1530, 1533, 1534, 1535, 1536, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1552, 1553, 1554, 1555, and 1556.

As previously stated, a Level value of 103 is not supported by the NetrServerSetInfo method. If the Level parameter has any other value, the server MUST fail the call with an ERROR_INVALID_LEVEL error code.

After receiving the NetrServerSetInfo method, the server MUST update the server setting that corresponds to the ServerInfo parameter. The format for the ServerInfo parameter is as specified in SERVER_INFO (section 2.2.3.7).

If the Level parameter is equal to 101, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_101 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 102, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_102 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 502, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_502 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 503, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_503 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 599, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_599 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1005, the server MUST update all the settings in ServerConfiguration that are defined by the SERVER_INFO_1005 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1107, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_1107 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1016, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_1016 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1017, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_1017 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1018, the server MUST update all the settings in ServerConfiguration.ServerInfo103 that are defined by the SERVER_INFO_1018 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1501, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1501 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1502, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1502 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1503, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1503 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1506, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1506 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1510, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1510 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1511, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1511 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1512, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1512 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1513, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1513 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1514, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1514 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1515, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1515 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1516, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1516 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1518, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1518 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1523, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1523 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1528, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1528 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1529, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1529 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1530, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1530 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1533, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1533 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1534, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1534 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1535, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1535 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1536, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1536 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1538, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1538 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1539, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1539 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1540, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1540 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1541, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1541 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1542, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1542 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1543, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1543 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1544, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1544 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1545, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1545 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1546, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1546 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1547, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1547 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1548, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1548 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1549, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1549 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1550, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1550 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1552, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1552 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1553, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1553 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1554, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1554 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1555, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1555 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

If the Level parameter is equal to 1556, the server MUST update all the settings in ServerConfiguration.ServerInfo599 that are defined by the SERVER_INFO_1556 structure as settable (that is, they are not defined as ignored on receipt or ignored for the NetrServerSetInfo method).

The server MUST validate each member of the structure that is passed in the ServerInfo parameter. The validation involves making sure each member of the structure in the ServerInfo parameter has a valid value as specified in the definition of the corresponding SERVER_INFO structure. If any member of the structure is not valid and the ParmErr parameter is not NULL, the server MUST set ParmErr to a value based on the first member of the structure that is not valid and fail the call with an ERROR_INVALID_PARAMETER (0x00000057) error code. The mapping between the values to set and the corresponding member is listed in section 2.2.2.12.<83>

The server MUST construct SERVER_INFO_103 and SERVER_INFO_599 structures from ServerConfiguration.ServerInfo103 and ServerConfiguration.ServerInfo599 respectively.

The server MUST update server configuration by invoking the underlying server event as specified in [MS-CIFS] section 3.3.4.22, providing SERVER_INFO_103 and SERVER_INFO_599 structures as input parameters.

The server MUST update browser configuration by invoking the underlying server event specified in [MS-BRWS] section 3.2.4.1, providing the SERVER_INFO_103 structure as input parameter.

The server MUST persist the values in ServerConfiguration.ServerInfo103 and ServerConfiguration.ServerInfo599 in a persistent configuration store.

The server SHOULD<84> enforce security measures to verify that the caller has the required permissions to execute this routine. If the caller does not have the required credentials, the server SHOULD<85> fail the call.