---
title: Stop
framework: BlockStorageDeviceDriverKit
role: symbol
role_heading: Instance Method
platforms: [driverkit 21.0+]
path: blockstoragedevicedriverkit/iouserblockstoragedevice/stop
---

# Stop

Stops the service associated with the specified provider.

## Declaration

```occ
virtual kern_return_t Stop(IOService *provider);
```

## Parameters

- `provider`: The provider associated with the current service. This object is the same one that the system previously passed to your service’s doc://com.apple.blockstoragedevicedriverkit/documentation/BlockStorageDeviceDriverKit/IOUserBlockStorageDevice/Start method.

## Return Value

Return Value A value that indicates the service-stopping result. Return kIOReturnSuccess to inidicate success. To indicate a failure, see IOKit Constants for error definitions.

## Discussion

Discussion Before terminating the object in provider, the system calls this method to stop the service associated with that object. Use your implementation of this method to stop all activity and put your driver in a quiescent state. If your driver has any in-progress asynchronous tasks, cancel those tasks and wait for DriverKit to call the associated cancellation handler before calling the super version of this method. Call super at the end of your implementation. After calling super, it’s a programmer error to access the provider object. Don’t use this method to release your ivars structure; use the free method instead.

## See Also

### Running the Service

- [init](blockstoragedevicedriverkit/iouserblockstoragedevice/init.md)
- [Start](blockstoragedevicedriverkit/iouserblockstoragedevice/start.md)
- [free](blockstoragedevicedriverkit/iouserblockstoragedevice/free.md)
