3.1.4.1 Stop (Opnum 7)

This method stops any running Internet services.<3>

The server can have all functionality through this interface disabled using actions taken local to the server machine. In this case the function MUST return an error when called (E_ERROR_RESOURCE_DISABLED) and MUST NOT perform any other action.

If the interface functionality is not disabled, the following actions SHOULD take place on the server when this method is called:

  • The method SHOULD first attempt a graceful stop of the services. If the caller has requested that the services be forced to stop and the code either fails to request the stops or times out (based on the dwTimeoutMsecs parameter) while waiting for the services to stop, it SHOULD terminate the processes to ensure that they stop. This procedure SHOULD use the Kill method, as specified in section 3.1.4.5, to handle the forced termination.<4>

     HRESULT Stop(
       DWORD dwTimeoutMsecs,
       DWORD dwForce
     );
    

dwTimeoutMsecs: Length of time allowed for services to stop. If this time has elapsed, and not all services have stopped, then the conditional behavior that follows SHOULD occur.

dwForce: Boolean value that specifies whether the services will be forced to terminate. If the graceful stopping of any service fails, then the conditional behavior that follows SHOULD occur.

Value

Meaning

TRUE

0x00000001

Services MUST be forced to terminate.

FALSE

0x00000000

Services MUST NOT be forced to terminate.

Return Values: A signed, 32-bit value indicating return status. If the method returns a negative value, it has failed. If the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a Win32 error code in the lower 16 bits. 0 or positive values indicate success, with the lower 16 bits in positive nonzero values containing warnings or flags defined in the method implementation. For more information about HRESULT, see [MS-ERREF] section 2.1.

The method MUST return S_OK (0x00000000) upon success.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070008

E_ERROR_NOT_ENOUGH_MEMORY

Not enough memory is available to process this command.

0x8007041D

E_ERROR_SERVICE_REQUEST_TIMEOUT

A time-out has occurred while waiting for the Internet services to be stopped.

0x800710D5

E_ERROR_RESOURCE_DISABLED

The IIisServiceControl interface is disabled.

If the length of time specified by dwTimeoutMsecs has elapsed and not all services have stopped, and if dwForce is set to 0x00000001 (True), then the remaining services SHOULD be forced to terminate.