IIisServiceControl::Stop

The IIisServiceControl::Stop method stops all Internet services (services dependent on IISADMIN), first using SCM and then optionally using TerminateProcess if the SCM does not stop the service in time.

STDMETHODIMP Stop(
      DWORD dwTimeoutMsecs,
      DWORD dwForce
);

Parameters

  • dwTimeoutMsecs
    The timeout for status check (in ms).

  • dwForce
    Forces TerminateProcess if failure to stop services using SCM occurs.

Return Values

This method returns ERROR_RESOURCE_DISABLED if remote access is disabled, and returns ERROR_SERVICE_REQUEST_TIMEOUT if the timeout is reached. Otherwise, COM status is returned.

Requirements

Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in iisrsta.h.