<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GSS",
  "identifier" : "/documentation/GSS/gss_inquire_context(_:_:_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@gss_inquire_context"
  },
  "title" : "gss_inquire_context(_:_:_:_:_:_:_:_:_:)"
}
-->

# gss_inquire_context(_:_:_:_:_:_:_:_:_:)

Returns information about a security context.

```
func gss_inquire_context(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ context_handle: gss_ctx_id_t, _ src_name: UnsafeMutablePointer<gss_name_t?>?, _ targ_name: UnsafeMutablePointer<gss_name_t?>?, _ lifetime_rec: UnsafeMutablePointer<OM_uint32>?, _ mech_type: UnsafeMutablePointer<gss_OID?>?, _ ctx_flags: UnsafeMutablePointer<OM_uint32>?, _ locally_initiated: UnsafeMutablePointer<Int32>?, _ xopen: UnsafeMutablePointer<Int32>?) -> OM_uint32
```

## Parameters

`minor_status`

A pointer to the secondary status result that provides additional information in case of failure.

`context_handle`

The context to obtain information about.

`src_name`

A pointer the function uses to return the name of the initiator. Free the name object’s memory with a call to [`gss_release_name(_:_:)`](/documentation/GSS/gss_release_name(_:_:)) when you are done with it. Specify `NULL` to ignore this output.

`targ_name`

A pointer the function uses to return the name of the acceptor. Free the name object’s memory with a call to [`gss_release_name(_:_:)`](/documentation/GSS/gss_release_name(_:_:)) when you are done with it. Specify `NULL` to ignore this output.

`lifetime_rec`

A pointer the function uses to return the number of seconds before the context expires, or zero if it has already expired. If the context does not support expiration, it returns [`GSS_C_INDEFINITE`](/documentation/GSS/GSS_C_INDEFINITE). Specify `NULL` to ignore this output.

`mech_type`

A pointer the function uses to return the mechanism providing the context. Do not release the OID object, because it is held in static memory. Specify `NULL` to ignore this output.

`ctx_flags`

A pointer the function uses to return the flags associated with the context. See [Context Services](/documentation/GSS/context-services) for a description of available flags. Specify NULL to ignore this output.

`locally_initiated`

A pointer the function uses to return an indicator of the context’s point of origin. The value is zero when the function is called by context’s acceptor and non-zero otherwise. Specify NULL to ignore this output.

`xopen`

A pointer the function uses to return an indicator of the context’s current state. The value is non-zero when the context if fully established and zero otherwise. Specify NULL to ignore this output.

## Return Value

A status code set to [`GSS_S_COMPLETE`](/documentation/GSS/GSS_S_COMPLETE) on success. See [Function Status](/documentation/GSS/function-status) for a description of other status outputs.

## Discussion

The context must exist but need not be fully established for the inquiry to succeed.

---

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)