DisplaySpecifiers 컨테이너

표시 지정자는 구성 컨테이너의 DisplaySpecifiers 컨테이너에 로캘별로 저장됩니다. 구성 컨테이너는 전체 포리스트에 복제되므로 표시 지정자는 포리스트의 모든 도메인에 전파됩니다.

구성 컨테이너는 DisplaySpecifiers 컨테이너를 저장한 다음 각 로캘에 해당하는 컨테이너를 저장합니다. 이러한 로캘 컨테이너는 로캘 식별자의 16진수 표현을 사용하여 명명됩니다. 예를 들어 미국/영어 로캘 컨테이너의 이름은 409이고, 독일 로캘의 컨테이너 이름은 407이고, 일본 로캘의 컨테이너 이름은 411입니다. 자세한 내용과 가능한 언어 식별자 목록은 언어 식별자 상수 및 문자열을 참조하세요.

각 로캘 컨테이너는 displaySpecifier 클래스의 개체를 저장합니다.

로캘에 대한 모든 표시 지정자를 나열하려면 DisplaySpecifiers 컨테이너 내의 지정된 로캘 컨테이너에 있는 모든 displaySpecifier 개체를 열거합니다.

다음 코드 예제에는 지정된 로캘에 대한 표시 지정자 컨테이너에 바인딩되는 함수가 포함되어 있습니다.

/**********
This function returns a pointer to the display specifier container 
for the specified locale.

If locale is NULL, use default system locale and then return the 
locale in the locale parameter.
***********/
HRESULT BindToDisplaySpecifiersContainerByLocale(
    LCID *locale,
    IADs **ppDispSpecCont)
{
HRESULT hr = E_FAIL;
 
if ((!ppDispSpecCont)||(!locale))
    return E_POINTER;
 
// If no locale is specified, use the default system locale.
if (!(*locale))
{
    *locale = GetSystemDefaultLCID();
    if (!(*locale))
        return E_FAIL;
}
 
// Be sure that the locale is valid.
if (!IsValidLocale(*locale, LCID_SUPPORTED))
    return E_INVALIDARG;
 
LPOLESTR szPath = new OLECHAR[MAX_PATH*2];
IADs *pObj = NULL;
VARIANT var;
 
hr = ADsOpenObject(L"LDAP://rootDSE",
                     NULL,
                     NULL,
                     ADS_SECURE_AUTHENTICATION,
                     IID_IADs,
                     (void**)&pObj);
 
if (SUCCEEDED(hr))
{
    // Get the DN to the configuration container.
    hr = pObj->Get(CComBSTR("configurationNamingContext"), &var);
    if (SUCCEEDED(hr))
    {
        // Build the string to bind to the container for the
        // specified locale in the DisplaySpecifiers container.
        swprintf_s(
            szPath, 
            L"LDAP://cn=%x,cn=DisplaySpecifiers,%s", 
            *locale, 
            var.bstrVal);

        // Bind to the container.
        *ppDispSpecCont = NULL;
        hr = ADsOpenObject(szPath,
                     NULL,
                     NULL,
                     ADS_SECURE_AUTHENTICATION,
                     IID_IADs,
                     (void**)ppDispSpecCont);
 
        if(FAILED(hr))
        {
            if ((*ppDispSpecCont))
            {
                (*ppDispSpecCont)->Release();
                (*ppDispSpecCont) = NULL;
            }
        }
    }
}
 
// Cleanup.
VariantClear(&var);
if (pObj)
    pObj->Release();
 
return hr;
}