> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UnregisterLampArrayCallback

> UnregisterLampArrayCallback

# UnregisterLampArrayCallback

LampArray 콜백 함수의 등록을 해제합니다.

## 구문

```cpp theme={null}
bool UnregisterLampArrayCallback(
    LampArrayCallbackToken callbackToken,
    uint64_t timeoutInMicroseconds);
```

### 매개변수

*callbackToken*\
형식: LampArrayCallbackToken

등록을 해제할 콜백 함수에 대한 토큰입니다. 이 함수가 [RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback)으로 처음 등록될 때 생성되었습니다.

*timeoutInMicroseconds*\
형식: uint64\_t

콜백이 완료되어 등록 해제될 수 있도록 기다릴 시간입니다.

### 반환값

형식: bool

콜백이 성공적으로 등록 해제되면 true입니다. false는 유효하지 않은 콜백 토큰 값이거나, 진행 중인 콜백이 반환되기를 기다리는 동안 시간이 초과되었음을 나타냅니다. false 반환의 경우에도 새 콜백은 디스패치되지 않도록 보장됩니다. 이미 진행 중인 콜백은 계속 실행됩니다.

## 설명

UnregisterLampArrayCallback 함수가 성공적으로 반환될 때까지는 콜백과 관련된 리소스를 해제(예: 콜백 함수를 호스팅하는 DLL 언로드)하는 것은 안전하지 않습니다. 따라서 등록된 콜백 함수 내부에서 콜백을 등록 해제하는 것은 불가능하며, 이를 시도하면 프로세스가 종료됩니다.

다음 코드는 LampArray 콜백을 등록하고 등록 해제하는 예제입니다.

```cpp theme={null}
void MyLampArrayCallback(
    _In_opt_ void* context,
    bool isAttached,
    _In_ ILampArray* lampArray)
{
    if (isAttached)
    {
        // Application-specific code to handle LampArray connection
    }
    else
    {
        // Application-specific code to handle LampArray disconnection
    }
}

void MonitorLampArrays(
    _In_ volatile bool & cancelMonitoring) noexcept
{
    LampArrayCallbackToken token = LAMPARRAY_INVALID_CALLBACK_TOKEN_VALUE;
    if (SUCCEEDED(RegisterLampArrayCallback(
        MyLampArrayCallback,
        nullptr /* context */,
        &token)))
    {
        while (!cancelMonitoring)
        {
            Sleep(100);
        }

        UnregisterLampArrayCallback(token, 5000);
    }
}
```

## 요구 사항

**헤더:** LampArray.h

**라이브러리:** xgameplatform.lib

**지원되는 플랫폼:** XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[Lighting API 개요](/build/core-features/common/lighting/gc-lighting-toc)\
[Lighting 기본 사항](/build/core-features/common/lighting/lighting-basics)\
[LampArrayCallback](/reference/lighting/lamparray/functions/lamparraycallback)\
[RegisterLampArrayCallback](/reference/lighting/lamparray/functions/registerlamparraycallback)


## Related topics

- [LampArray](/ko/reference/lighting/lamparray/lamparray_members.md)
- [LampArrayCallback](/ko/reference/lighting/lamparray/functions/lamparraycallback.md)
- [LampArrayStatusCallback](/ko/reference/lighting/lamparray/functions/lamparraystatuscallback.md)
- [RegisterLampArrayCallback](/ko/reference/lighting/lamparray/functions/registerlamparraycallback.md)
- [RegisterLampArrayStatusCallback](/ko/reference/lighting/lamparray/functions/registerlamparraystatuscallback.md)
