3.1.4.17 NetrServerGetInfo (Opnum 21)

The NetrServerGetInfo method retrieves current configuration information for CIFS and SMB Version 1.0 servers.

 NET_API_STATUS NetrServerGetInfo(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD Level,
   [out, switch_is(Level)] LPSERVER_INFO InfoStruct
 );

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).

Level: Specifies the information level of the data. The value of the Level parameter determines the contents of the InfoStruct parameter. This parameter MUST be one of the following values.

Value

Meaning

100

LPSERVER_INFO_100

101

LPSERVER_INFO_101

102

LPSERVER_INFO_102

103

LPSERVER_INFO_103

502

LPSERVER_INFO_502

503

LPSERVER_INFO_503

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

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.

0x00000008

ERROR_NOT_ENOUGH_MEMORY

Not enough storage is available to process this command.

In response to the NetrServerGetInfo request, the server MUST return configuration information from the ServerConfiguration object based on the value of the Level parameter.

The value of the Level parameter can be 100, 101, 102, 502, or 503. If the Level parameter has any other value, the server MUST fail the call with an ERROR_INVALID_LEVEL error code.<77>

The value of the Level parameter determines the format of the InfoStruct parameter.

If the value of the Level parameter is 100, the server MUST return its information by filling the SERVER_INFO_100 structure in the ServerInfo100 member of the InfoStruct parameter.

  • sv100_platform_id MUST be set to ServerConfiguration.ServerInfo103.sv103_platform_id.

  • If the ServerName parameter is NULL, sv100_name MUST be set to ServerConfiguration.ServerInfo103.sv103_name. Otherwise, sv100_name MUST be set to the value of ServerName.

If the value of the Level parameter is 101, the server MUST return its information by filling the SERVER_INFO_101 structure in the ServerInfo101 member of the InfoStruct parameter.

  • sv101_platform_id MUST be set to ServerConfiguration.ServerInfo103.sv103_platform_id.

  • If the ServerName parameter is NULL, sv101_name MUST be set to ServerConfiguration.ServerInfo103.sv103_name. Otherwise, sv101_name MUST be set to the value of ServerName.

  • sv101_sv101_version_major MUST be set to ServerConfiguration.ServerInfo103.sv103_version_major.

  • sv101_version_minor MUST be set to ServerConfiguration.ServerInfo103.sv103_version_minor.

  • sv101_type MUST be set to GlobalServerAnnounce.

  • sv101_comment MUST be set to ServerConfiguration.ServerInfo103.sv103_comment.

If the value of the Level parameter is 102, the server MUST return its information by filling the SERVER_INFO_102 structure in the ServerInfo102 member of the InfoStruct parameter.

  • sv102_platform_id MUST be set to ServerConfiguration.ServerInfo103.sv103_platform_id.

  • If the ServerName parameter is NULL, sv102_name MUST be set to ServerConfiguration.ServerInfo103.sv103_name. Otherwise,  sv102_name MUST be set to the value of ServerName.

  • sv102_ version_major MUST be set to ServerConfiguration.ServerInfo103.sv103_version_major.

  • sv102_version_minor MUST be set to ServerConfiguration.ServerInfo103.sv103_version_minor.

  • sv102_type MUST be set to GlobalServerAnnounce.

  • sv102_comment MUST be set to ServerConfiguration.ServerInfo103.sv103_comment.

  • sv102_users MUST be set to ServerConfiguration.ServerInfo103.sv103_users.

  • sv102_disc MUST be set to ServerConfiguration.ServerInfo103.sv103_disc.

  • sv102_hidden MUST be set to ServerConfiguration.ServerInfo103.sv103_hidden.

  • sv102_anndelta MUST be set to ServerConfiguration.ServerInfo103.sv103_anndelta.

  • sv102_licenses MUST be set to 0.

If the value of the Level parameter is 103, the server MUST return server information in ServerConfiguration.ServerInfo103 directly by filling the SERVER_INFO_103 structure in the ServerInfo103 member of the InfoStruct parameter and setting sv103_type to GlobalServerAnnounce.<78>

If the value of the Level parameter is 502, the server MUST return its information by filling the SERVER_INFO_502 structure in the ServerInfo502 member of the InfoStruct parameter.

  • sv502_sessopens MUST be set to ServerConfiguration.ServerInfo599.sv599_sessopens.

  • sv502_sessvcs MUST be set to ServerConfiguration.ServerInfo599.sv599_sessvcs.

  • sv502_opensearch MUST be set to ServerConfiguration.ServerInfo599.sv599_opensearch.

  • sv502_sizreqbuf MUST be set to ServerConfiguration.ServerInfo599.sv599_sizreqbuf.

  • sv502_initworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_initworkitems.

  • sv502_maxworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_maxworkitems.

  • sv502_rawworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_rawworkitems.

  • sv502_irpstacksize MUST be set to ServerConfiguration.ServerInfo599.sv599_irpstacksize.

  • sv502_maxrawbuflen MUST be set to ServerConfiguration.ServerInfo599.sv599_maxrawbuflen.

  • sv502_sessusers MUST be set to ServerConfiguration.ServerInfo599.sv599_sessusers.

  • sv502_sessconns MUST be set to ServerConfiguration.ServerInfo599.sv599_sessconns.

  • sv502_maxpagedmemoryusage MUST be set to ServerConfiguration.ServerInfo599.sv599_maxpagedmemoryusage.

  • sv502_maxnonpagedmemoryusage MUST be set to ServerConfiguration.ServerInfo599.sv599_maxnonpagedmemoryusage.

  • sv502_enablesoftcompat MUST be set to ServerConfiguration.ServerInfo599.sv599_enablesoftcompat.

  • sv502_enableforcedlogoff MUST be set to ServerConfiguration.ServerInfo599.sv599_enableforcedlogoff.

  • sv502_timesource MUST be set to ServerConfiguration.ServerInfo599.sv599_timesource.

  • sv502_acceptdownlevelapis MUST be set to ServerConfiguration.ServerInfo599.sv599_acceptdownlevelapis.

  • sv502_lmannounce MUST be set to ServerConfiguration.ServerInfo599.sv599_ lmannounce.

If the value of the Level parameter is 503, the server MUST return its information by filling the SERVER_INFO_503 structure in the ServerInfo503 member of the InfoStruct parameter.

  • sv503_sessopens MUST be set to ServerConfiguration.ServerInfo599.sv599_sessopens.

  • sv503_sessvcs MUST be set to ServerConfiguration.ServerInfo599.sv599_sessvcs.

  • sv503_opensearch MUST be set to ServerConfiguration.ServerInfo599.sv599_opensearch.

  • sv503_sizreqbuf MUST be set to ServerConfiguration.ServerInfo599.sv599_sizreqbuf.

  • sv503_initworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_initworkitems.

  • sv503_maxworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_maxworkitems.

  • sv503_rawworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_rawworkitems.

  • sv503_irpstacksize MUST be set to ServerConfiguration.ServerInfo599.sv599_irpstacksize.

  • sv503_maxrawbuflen MUST be set to ServerConfiguration.ServerInfo599.sv599_maxrawbuflen.

  • sv503_sessusers MUST be set to ServerConfiguration.ServerInfo599.sv599_sessusers.

  • sv503_sessconns MUST be set to ServerConfiguration.ServerInfo599.sv599_sessconns.

  • sv503_maxpagedmemoryusage MUST be set to ServerConfiguration.ServerInfo599.sv599_maxpagedmemoryusage.

  • sv503_maxnonpagedmemoryusage MUST be set to ServerConfiguration.ServerInfo599.sv599_maxnonpagedmemoryusage.

  • sv503_enablesoftcompat MUST be set to ServerConfiguration.ServerInfo599.sv599_enablesoftcompat.

  • sv503_enableforcedlogoff MUST be set to ServerConfiguration.ServerInfo599.sv599_enableforcedlogoff.

  • sv503_timesource MUST be set to ServerConfiguration.ServerInfo599.sv599_timesource.

  • sv503_acceptdownlevelapis MUST be set to ServerConfiguration.ServerInfo599.sv599_acceptdownlevelapis.

  • sv503_lmannounce MUST be set to ServerConfiguration.ServerInfo599.sv599_lmannounce.

  • sv503_domain MUST be set to ServerConfiguration.ServerInfo599.sv599_domain.

  • sv503_maxcopyreadlen MUST be set to ServerConfiguration.ServerInfo599.sv599_maxcopyreadlen.

  • sv503_maxcopywritelen MUST be set to ServerConfiguration.ServerInfo599.sv599_maxcopywritelen.

  • sv503_minkeepsearch MUST be set to ServerConfiguration.ServerInfo599.sv599_minkeepsearch.

  • sv503_maxkeepsearch MUST be set to ServerConfiguration.ServerInfo599.sv599_maxkeepsearch.

  • sv503_minkeepcomplsearch MUST be set to ServerConfiguration.ServerInfo599.sv599_minkeepcomplsearch.

  • sv503_maxkeepcomplsearch MUST be set to ServerConfiguration.ServerInfo599.sv599_maxkeepcomplsearch.

  • sv503_threadcountadd MUST be set to ServerConfiguration.ServerInfo599.sv599_threadcountadd.

  • sv503_numblockthreads MUST be set to ServerConfiguration.ServerInfo599.sv599_numblockthreads.

  • sv503_scavtimeout MUST be set to ServerConfiguration.ServerInfo599.sv599_scavtimeout.

  • sv503_minrcvqueue MUST be set to ServerConfiguration.ServerInfo599.sv599_minrcvqueue.

  • sv503_minfreeworkitems MUST be set to ServerConfiguration.ServerInfo599.sv599_minfreeworkitems.

  • sv503_xactmemsize MUST be set to ServerConfiguration.ServerInfo599.sv599_xactmemsize.

  • sv503_threadpriority MUST be set to ServerConfiguration.ServerInfo599.sv599_threadpriority.

  • sv503_maxmpxct MUST be set to ServerConfiguration.ServerInfo599.sv599_maxmpxct.

  • sv503_oplockbreakwait MUST be set to ServerConfiguration.ServerInfo599.sv599_oplockbreakwait.

  • sv503_oplockbreakresponsewait MUST be set to ServerConfiguration.ServerInfo599.sv599_oplockbreakresponsewait.

  • sv503_enableoplocks MUST be set to ServerConfiguration.ServerInfo599.sv599_enableoplocks.

  • sv503_enableoplockforceclose MUST be set to ServerConfiguration.ServerInfo599.sv599_enableoplockforceclose.

  • sv503_enablefcbopens MUST be set to ServerConfiguration.ServerInfo599.sv599_enablefcbopens.

  • sv503_enableraw MUST be set to ServerConfiguration.ServerInfo599.sv599_enableraw.

  • sv503_enablesharednetdrives MUST be set to ServerConfiguration.ServerInfo599.sv599_enablesharednetdrives.

  • sv503_minfreeconnections MUST be set to ServerConfiguration.ServerInfo599.sv599_minfreeconnections.

  • sv503_maxfreeconnections MUST be set to ServerConfiguration.ServerInfo599.sv599_maxfreeconnections.

The server SHOULD<79> 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<80> fail the call.

The ServerName parameter MUST be either NULL or a null-terminated string, as described in section 2.2.1.1. If it is non-NULL, the length of the string MUST be less than 1,024 or the server MUST fail the call with ERROR_INVALID_PARAMETER.