<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecPolicySearchCopyNext",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecPolicySearchCopyNext"
  },
  "title" : "SecPolicySearchCopyNext"
}
-->

# SecPolicySearchCopyNext

Retrieves a policy object for the next policy matching specified search criteria.

```
OSStatus SecPolicySearchCopyNext(SecPolicySearchRef searchRef, SecPolicyRef*policyRef);
```

## Parameters

`searchRef`

A policy search object specifying the search criteria for this search. You create the policy search object by calling the [`SecPolicySearchCreate`](/documentation/Security/SecPolicySearchCreate) function.

`policyRef`

On return, points to the policy object for the next policy (if any) matching the specified search criteria. In Objective-C, call the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function to release this object when you are finished with it.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes). When there are no more policies that match the parameters specified to [`SecPolicySearchCreate`](/documentation/Security/SecPolicySearchCreate), [`errSecPolicyNotFound`](/documentation/Security/errSecPolicyNotFound) is returned.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)