The Win32 Network Management APIs 5

 

 

 

 

 

Message Functions

 

[The message functions are not supported as of Windows Vista because the alerter and messenger services are not supported.]

The network management message functions send messages and maintain message aliases. The message functions are listed following. For Windows Server 2003:  The alerter and messenger services are disabled by default. You must re-enable the services before calling the network management Alert functions or the network management Message functions.

 

Function

Description

NetMessageBufferSend()

Sends a message to a registered message alias.

NetMessageNameAdd()

Registers a message alias in the message name table.

NetMessageNameDel()

Deletes a message alias from the message name table.

NetMessageNameEnum()

Lists all the message aliases stored in the message name table.

NetMessageNameGetInfo()

Returns information about a particular message alias in the message name table.

 

A message is a buffer of text data sent to a user or application on the network. To receive a message, a user or application must register a message alias in a computer's table of message names. The following aliases are registered by default: "user", "machine", "domain", or "*" (the current domain of the computer). The "domain" alias specifies the set of computers that have the same domain name defined as their domain or as their workgroup and listen to broadcasts on the same subnet. For NetBIOS over TCP/IP, specifying the "domain" alias can also succeed across subnets if the domain name is resolved by a name server, or if NetBIOS datagram broadcasts are forwarded across routers. Therefore, messages sent to a domain do not have guaranteed delivery to all members of the domain. It is also possible for some domain members to receive the message multiple times if they have multiple transports installed that support NetBIOS. You can also register a message alias by calling the NetMessageNameAdd() function. A message name table contains a list of registered message aliases (users and applications) permitted to receive messages. The aliases registered in the message name table are case insensitive. The messenger service must be running on the receiving computer to display a pop-up message when the message is received. In addition, the Workstation service must be running on the local computer. NetBIOS is the transport mechanism used between the sender and receiver. Message functions are available at two information levels:

 

  1. MSG_INFO_0
  2. MSG_INFO_1

 

The MSG_INFO_1 information level exists only for compatibility. The messenger service does not forward names or allow names to be forwarded to it.

 

NetFile Functions

 

The network management file functions provide a way to monitor and close the file, device, and pipe resources open on a server. The file functions are listed following.

 

Function

Description

NetFileClose()

Forces a resource to close.

NetFileEnum()

Returns information about open files on a server.

NetFileGetInfo()

Returns information about a particular opening of a server resource.

 

Call the NetFileClose() function when the file cannot be closed by any other means. This function should be used with caution because NetFileClose() does not write data cached on the client system to the file before closing the file. The NetFileEnum() function returns information about resources open on a server. A file can be opened one or more times by one or more applications. Each file opening is uniquely identified. The NetFileEnum() function returns an entry for each file opening. The NetFileGetInfo() function returns information about one opening of a resource. File information is available at the following levels:

 

  1. FILE_INFO_2
  2. FILE_INFO_3

 

Levels 0 and 1 are not supported. Level 2 returns only the identification number assigned to the resource when it was opened. Level 3 returns the identification number, permissions, file locks, and the name of the user who opened the resource. If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling the NetFileEnum() and NetFileGetInfo() functions.

 

Remote Utility Functions

 

The network management remote utility functions are listed following.

 

Function

Description

NetRemoteComputerSupports()

Queries the redirector to retrieve the optional features that a remote system supports.

NetRemoteTOD()

Enables applications to access the time-of-day information on a remote server.

 

The remote time-of-day information is available at one information level: TIME_OF_DAY_INFO

 

Replicator Functions

 

[Note that the replicator functions work only when the target computer is running Windows NT and the local computer is running Windows NT or Windows 2000.]

The replicator service maintains identical sets of files and directories on different servers and workstations running Windows NT. When you update files on one server, the file replicator service replaces the corresponding files on other servers and workstations with the updated files. The replication process simplifies the task of updating and coordinating files, and maintains the integrity of the replicated data. Replication is controlled by options you set in the LanMan.ini file using the following categories of network management replicator functions (will be discussed later):

 

  1. Replicator configuration functions
  2. Replicator export directory functions
  3. Replicator import directory functions

 

 

 

 

< Win32 Network Management APIs 4 | Win32 Network Management APIs | Win32 Programming | Win32 Network Management APIs 6 >