SC implements calls to all of the Windows NT service control
application programming interface (API) functions. It is provided with
SDK. SC also displays service status and retrieves the values stored
in the status structure fields. The utility also lets you specify the name
of a remote computer so that you can call the service API functions or
view the service status structures on the remote computer.
SC also allows you to call any of the service
control API functions and vary any of the parameters from the command line.
This offers several advantages to the service developer. For instance,
it provides a convenient way of creating or configuring the service information
in the Registry and the Service Control Manager's database. The developer
doesn't have to configure the service by manually creating entries in the
Registry and then rebooting the machine in order to force the Service Control
Manager to update its database.
You can create batch (command) files that call SC
with various parameters that control the service. This is useful if you
want to see how your service behaves when it is repeatedly started and
stopped. If you have more than one service in your service process, you
can leave one service running so that the process doesn't go away, and
then repeatedly start and stop the other service while looking for evidence
of memory leaks due to an incomplete cleanup.
Automatically Starting Services
During system boot, the SCM starts all auto-start services and the services on which they depend. For example, if an auto-start service depends on a demand-start service, the demand-start service is also started automatically.
Varias claves de HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control afectan al modo de carga y verificación. The load order is determined by the following:
If an auto-start service with a SERVICE_ERROR_CRITICAL error control level fails to start, the SCM reboots the machine using the LKG configuration. If the LKG configuration is already being used, the boot fails.
SERVICE
Servicio
Añadiendo un servicio
En este ejemplo añadimos el servicio PROCESO.BAT y lo configuramos para que se ejecute al cargar el servicio de acceso remoto.
Necesitamos INSTSRV.EXE y SRVANY.EXE: vienen en el Kit de recursos.Copiar SRVANY.EXE al directorio %SystemRoot%\System32 (c:\windows\ en el ejemplo).
Para añadir el nuevo servicio hay que ejecutar en una ventana
DOS:
INSTSRV PROCESO C:\WINDOWS\SYSTEM32\SRVANY.EXE
Usando REGIDT32.EXE colocar:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \PROCESO\DependOnService
REG_MULTI_SZ: RemoteAccess
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ PROCESO
\ Parameters\Application
REG_SZ: C:\Windows\System32\drivers\etc\PROCESO.BAT
En el Panel de Control, en Servicios , debemos seleccionar PROCESO y
colocar el aranque en modo automático.
SOCKET
Conexión
Windows Sockets specifies a programming interface based on the familiar "socket" interface from the University of California at Berkeley. It includes a set of extensions designed to take advantage of the message-driven nature of Microsoft Windows. Version 1.1 of the specification was released in January 1993, and version 2.0 is in a provisional state at the time of this writing. Currently, support for raw sockets is not available, however it is planned for a future release.
Applications
There are many Windows Sockets applications available. A number of
the utilities that ship with Windows NT are Windows Sockets based, including
the FTP and DHCP clients and servers, telnet client, etc.
Name Resolution
Windows Sockets applications generally use the gethostbyname() call
to resolve a hostname to an IP address. The gethostbyname() call uses the
following (default) name lookup sequence:
The Backlog Parameter
Windows Sockets server applications generally create a socket and then
use listen() to listen on it for connection requests. One of the parameters
passed when calling listen() is the backlog of connection requests that
the application would like Windows Sockets to queue for it. The Windows
Sockets 1.1 specification indicates that the maximum allowable value for
backlog is 5; however, Windows NT will accept a backlog of up to 100. The
FTP server in version 3.51 was modified to allow configuration of the backlog
parameter by the administrator. FTP servers that are heavily used may benefit
from increasing the backlog to a larger number than the default of 5.