3.1.3 Initialization

The server MUST initialize GlobalServerAnnounce to SV_TYPE_SERVER. The server SHOULD combine any architecture-specific flags defined in section 2.2.2.7 to the GlobalServerAnnounce value using the bitwise OR operation.<37>

The server MUST initialize PrinterShareCount to 0.

The server MUST initialize NullSessionPipeList with implementation-specific defaults or with values from the persistent store.<38>

Guest account support is optional and can be disabled.

The server MUST set CifsInitialized to FALSE.

The server MUST set Smb2Initialized to FALSE.

The server MUST wait until CifsInitialized and Smb2Initialized are set to TRUE.<39>

The server MUST initialize ServerConfiguration.ServerInfo103 as follows:

  • sv103_name MUST be set to the NetBIOS host name of the server.

  • sv103_type MUST be set to GlobalServerAnnounce.

  • sv103_capabilities MUST be set as follows.

    • If the server does not support SMB2 or does not support Content Information Retrieval requests as specified in [MS-SMB2] section 3.3.5.15.7, sv103_capabilities MUST be set to 0.

    • If the server supports Content Information Retrieval requests but the local component that generates hashes locally is not installed, sv103_capabilities MUST be set to SRV_SUPPORT_HASH_GENERATION.

    • If the server supports Content Information Retrieval requests and the local component that generates hashes is installed, sv103_capabilities MUST be set to (SRV_SUPPORT_HASH_GENERATION | SRV_HASH_GENERATION_ACTIVE).

  • sv103_platform_id, sv103_version_major, sv103_version_minor, sv103_comment, sv103_users, sv103_disc, sv103_hidden, sv103_announce, and sv103_anndelta are initialized with implementation-specific defaults or with values from the persistent configuration store.<40>

The server MUST initialize ServerConfiguration.ServerInfo599 with implementation-specific defaults or with values from the persistent store.<41>

The server MUST initialize DefaultServerName to NULL.

The server MUST initialize TransportList to an empty list.

The server MUST then read each Transport stored in the persistent store and construct a SERVER_TRANSPORT_INFO_3 structure (specified in section 2.2.4.96) as follows:

  • svti3_numberofvcs MUST be set to zero.

  • svti3_transportname MUST be set to Transport.Name.

  • svti3_transportaddress MUST be set to Transport.ServerName.

  • svti3_transportaddresslength MUST be set to the length of Transport.ServerName.

  • svti3_networkaddress MUST be set to NULL.

  • svti3_domain MUST be set to Transport.Domain.

  • svti3_flags MUST be set to Transport.Flags.

The server MUST then invoke the NetrServerTransportAddEx method specified in section 3.1.4.23, passing SERVER_TRANSPORT_INFO_3 as the Buffer parameter and 3 as the Level parameter.

The server MUST initialize TreeConnectList to an empty list.

The server MUST initialize FileList to an empty list.

The server MUST initialize SessionList to an empty list.

The server MUST initialize AliasList to an empty list. The server MUST then add aliases stored in the persistent configuration store by invoking the NetrServerAliasAdd method specified in section 3.1.4.44 and passing the InfoStruct and Level parameters stored in the persistent configuration store.

The server MUST initialize ShareList to an empty list.

The server MUST then read each Share stored in the persistent store and construct a SHARE_INFO_503_I structure (specified in section 2.2.4.27) as follows:

  • share.shi503_netname MUST be set to Share.ShareName.

  • share.shi503_type MUST be set to Share.Type.

  • share.shi503_remark MUST be set to Share.Remark.

  • share.shi503_permissions MUST be set to 0.

  • share.shi503_max_uses MUST be set to Share.MaxUses.

  • share.shi503_current_uses MUST be set to 0.

  • share.shi503_path MUST be set to Share.LocalPath.

  • share.shi503_passwd MUST be set to NULL.

  • share.shi503_security_descriptor MUST be set to Share.FileSecurity.

  • share.shi503_servername MUST be set to Share.ServerName.

The server MUST then add shares by invoking the NetrShareAdd method specified in section 3.1.4.7 and passing the SHARE_INFO_503_I as InfoStruct and 503 as Level parameters.

The server MUST then construct a SHARE_INFO_1005 structure (specified in section 2.2.4.29) as follows:

  • shi1005_flags MUST be set to the result of bitwise AND of CSC_MASK and Share.CscFlags.

  • SHI1005_FLAGS_DFS and SHI1005_FLAGS_DFS_ROOT bits in shi1005_flags MUST be set if Share.IsDfs is TRUE.

  • SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM bit in shi1005_flags MUST be set if Share.DoAccessBasedDirectoryEnumeration is TRUE.

  • SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING bit in shi1005_flags MUST be set if Share.AllowNamespaceCaching is TRUE.

  • SHI1005_FLAGS_FORCE_SHARED_DELETE bit in shi1005_flags MUST be set if Share.ForceSharedDelete is TRUE.

  • SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS bit in shi1005_flags MUST be set if Share.RestrictExclusiveOpens is TRUE.

  • SHI1005_FLAGS_ENABLE_HASH bit in shi1005_flags MUST be set if Share.HashEnabled is TRUE.

  • SHI1005_FLAGS_FORCE_LEVELII_OPLOCK bit in shi1005_flags MUST be set if Share.ForceLevel2Oplock is TRUE.

The server MUST then update shares by invoking the NetrShareSetInfo method specified in section 3.1.4.11 and passing the SHARE_INFO_1005 as InfoStruct and 1005 as Level parameters.

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

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

The server MUST enable the SMB server as specified in [MS-CIFS] section 3.3.4.18  and MUST set CifsEnabled to TRUE.

The server MUST enable the SMB2 server as specified in [MS-SMB2] section 3.3.4.22  and MUST set Smb2Enabled to TRUE.

The server MUST initialize StatisticsStartTime to the number of seconds that have elapsed since 00:00:00, January 1, 1970, Greenwich Mean Time (GMT).