IWMSContext::GetIUnknownValue

banner art

Previous Next

IWMSContext::GetIUnknownValue

The GetIUnknownValue method retrieves an IUnknown value from the context.

Syntax

  HRESULT GetIUnknownValue(
  LPCWSTR  pstrName,
  long  lNameHint,
  IUnknown**  pValue,
  long  lOptions
);

Parameters

pstrName

[in] LPCWSTR specifying the name portion of the name-value pair in the context.

lNameHint

[in] long containing an optional key that can be used to more efficiently access a value.

pValue

[out] Pointer to a pointer to the IUnknown value.

lOptions

[in] Reserved for future use.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
DISP_E_BADINDEX 0x8002000B The property specified by the pstrName parameter could not be found.
DISP_E_TYPEMISMATCH 0x80020005 The data type of the property specified by the pstrName parameter is not VT_UNKNOWN.
E_POINTER 0x80004003 The pValue parameter is NULL.

Example Code

// Declare variables.
HRESULT hr = S_OK;
IUnknown *punk = NULL;
IWMSAuthenticationContext* &pAuthenContext = NULL

// Retrieve an IUnknown pointer to the authentication interface 
// from the user context.
if (NULL != pUserCtx)
{
    hr = pUserCtx->GetIUnknownValue( WMS_USER_AUTHENTICATOR,
                                     WMS_USER_AUTHENTICATOR_ID,
                                     &punk, 0 );
    if (FAILED(hr)) goto EXIT;

    // Call QueryInterface() to retrieve the IWMSAuthenticationContext 
    // pointer.
    hr = punk->QueryInterface( IID_IWMSAuthenticationContext, 
                           (void**) &pAuthenContext );
    if (FAILED(hr)) goto EXIT;
}

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: wmscontext.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next