The User object represents the user information published on the ILS server.
IIlsUser Interface |
IConnectionPoint—IIlsUserNotify Interface |
The IIlsUser interface is obtained from the IIlsMain::CreateUser, IIlsMain::EnumUsers, or IIlsMain::GetUser method. This section describes the IIlsUser interface methods.
HRESULT IIlsUser::AddProtocol(
IIlsProtocol *pProtocol,
ULONG *puReqID);
Adds a new protocol for the user's application.
S_OK | Success. |
ILS_E_POINTER | Address of the protocol interface is NULL, or the address request identifier is NULL. |
ILS_E_PARAMETER | A protocol by this name already exists. |
ILS_E_FAIL | Could not add protocol; user is in the middle of registration or unregistration. |
ILS_E_NOT_INITIALIZED | IIlsMain interface is not initialized. |
Depending on the User object registration state, this method can be either synchronous or asynchronous. If the User object is unregistered when the AddProtocol method is called to add a protocol object to the User object, this method returns synchronously and requires no interaction with the server. The protocol object will be added when the User object registers with the server. If the user object is already registered at the time of calling AddProtocol, the call is asynchronous and will involve sending an update to the server to add the Protocol object to the User object. If asynchronous, the application receives the IIlsUserNotify::ProtocolChangeResult notification for the request result.
HRESULT IIlsUser::Clone(
[out] IIlsUser **ppUser);
Returns a cloned version of the User object, with the identical set of standard and extended attributes set before this method is called.
A cloned object can be used to register the same user to different servers. There is no synchronization between the cloned and the original User object.
To ensure that all attributes are written correctly, the User object to be cloned should be registered on a server and updated before calling Clone.
HRESULT IIlsUser::CreateProtocol(
BSTR bstrProtocolID,
ULONG uPortNumber,
BSTR bstrMimeType,
IIlsProtocol **ppProtocol);
Creates a Protocol object that represents a protocol the user's application can use to establish the communication channel.
S_OK | Success. |
ILS_E_POINTER | Pointer to hold the protocol interface is NULL. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
HRESULT IIlsUser::EnumProtocols(
IIlsFilter *pFilter,
IIlsAttributes *pAttributes,
IEnumIlsProtocol **ppEnumProtocol,
ULONG *puReqID);
Returns a protocol enumerator for the user's application, with an option to apply an enumeration filter and an option to retrieve extended protocol attributes.
S_OK | Success. |
ILS_E_POINTER | Address request identifier is NULL. |
ILS_E_ACCESS_DENIED | User object is not read-only. |
ILS_E_NOT_INITIALIZED | IIlsMain interface is not initialized. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
This method is currently an asynchronous operation, but the interface is defined to enable future implementation of synchronous operation. When called asynchronously, the application receives the IIlsUserNotify::EnumProtocolsResult notification for the enumeration result.
HRESULT IIlsUser::GetAllExtendedAttributes(
IIlsAttributes **ppAttributes);
Returns all extended attributes, in the form of an Attributes object, from the User object. This is an alternative to getting each extended attribute individually through IIlsUser::GetExtendedAttribute.
S_OK | Success. |
ILS_E_PARAMETER | Return buffer pointer is NULL. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_ACCESS_CONTROL | Attribute type is ILS_ATTRTYPE_NAME_ONLY. |
HRESULT IIlsUser::GetExtendedAttribute(
BSTR bstrName,
BSTR *pbstrValue);
Retrieves an extended attribute from a User object that was previously retrieved from the server.
S_OK | Success. |
ILS_E_ACCESS_CONTROL | Attribute type is ILS_ATTRTYPE_NAME_ONLY. |
ILS_E_POINTER | Address of the return buffer is NULL or attribute name is NULL. |
ILS_E_PARAMETER | Attribute name is empty. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_FAIL | Attribute not found. |
HRESULT IIlsUser::GetGuid(
GUID *pGuid);
Returns the GUID (globally unique identifier) of the retrieved User object.
HRESULT IIlsUser::GetProtocol(
BSTR bstrProtocolID,
IIlsAttributes *pAttributes,
IIlsProtocol **ppProtocol,
ULONG *puReqID);
Requests a specific Protocol object that belongs to the user.
S_OK | Success. |
ILS_E_POINTER | Address of the protocol identifier is NULL, or address request identifier is NULL. |
ILS_E_ACCESS_DENIED | User object is not read-only. |
ILS_E_FAIL | An error has occurred. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_NOT_INITIALIZED | IIlsMain interface is not initialized. |
This method is currently an asynchronous operation, but the interface is defined to enable future implementation of synchronous operation. When called asynchronously, the application receives the IIlsUserNotify::GetProtocolResult notification for the request. The Protocol object can be used to retrieve information about the protocol.
HRESULT IIlsUser::GetStandardAttribute(
ILS_STD_ATTR_NAME StdAttr,
BSTR *pbstrValue);
Returns a standard attribute belonging to the user.
S_OK | Success. |
ILS_E_POINTER | Invalid address of an attribute variable. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_PARAMETER | Attribute name is invalid. |
ILS_STDATTR_USER_ID | Unique identifier of the user. |
ILS_STDATTR_IP_ADDRESS | IP address of the user. |
ILS_STDATTR_EMAIL_NAME | E-mail name of the user. |
ILS_STDATTR_FIRST_NAME | First name of the user. |
ILS_STDATTR_LAST_NAME | Last name of the user. |
ILS_STDATTR_CITY_NAME | Name of the city in which the user is located. |
ILS_STDATTR_COUNTRY_NAME | Name of the country in which the user is located. |
ILS_STDATTR_COMMENT | General textual comment. |
ILS_STDATTR_FLAGS | Flags need to be set to "1" for the User object to be visible in enumeration. |
ILS_STDATTR_APP_NAME | Unique string identifying the application. |
ILS_STDATTR_APP_MIME_TYPE | MIME type used by the application. |
ILS_STDATTR_APP_GUID | GUID (globally unique identifier) of the application. |
NetMeeting uses two-letter country codes for ILS_STDATTR_COUNTRY_NAME.
HRESULT IIlsUser::GetState(
ILS_STATE *pState);
Returns the registration state on the specified ILS server.
ILS_REGISTERING | The user is being registered with the ILS server. |
ILS_REGISTERED | The user is registered with the ILS server. |
ILS_UNREGISTERING | The user is unregistered with the ILS server. |
ILS_UNREGISTERED | The user is not registered with the ILS server. |
ILS_REGISTERED_BUT_INVALID | Server does not recognize the current user. |
ILS_NETWORK_DOWN | Cannot connect to the server. |
HRESULT IIlsUser::GetVisible(
DWORD *pdwVisible);
Returns the visible state of the user.
HRESULT IIlsUser::IsWritable(
BOOL *pValue);
Returns whether the User object can be written to.
User objects returned from enumeration or IIlsMain::GetUser cannot be written to, but those created through IIlsMain::CreateUser can.
HRESULT IIlsUser::Register(
IIlsServer *pServer,
ULONG *puReqID);
Publishes the user information to the ILS server.
S_OK | Success. |
ILS_E_ALREADY_REGISTERED | This user is already registered on a server. |
ILS_E_POINTER | Server pointer or request identifier is NULL. |
ILS_E_ACCESS_DENIED | User object is read-only. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_FAIL | Could not register; server or user is not in correct state. |
This method is an asynchronous operation. The application receives the IIlsUserNotify::RegisterResult notification for the registration result.
HRESULT IIlsUser::RemoveExtendedAttribute(
BSTR bstrName);
Removes an extended attribute from the User object. The modification will not be reflected on the ILS server until the IIlsUser::Register or IIlsUser::Update method is called.
S_OK | Success. |
ILS_E_ACCESS_DENIED | User object is not writable. |
ILS_E_ACCESS_CONTROL | Attribute type is ILS_ATTRTYPE_NAME_ONLY. |
ILS_E_POINTER | Attribute name is NULL. |
ILS_E_PARAMETER | Attribute name is empty. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
HRESULT IIlsUser::RemoveProtocol(
IIlsProtocol *pProtocol,
ULONG *puReqID);
Removes a protocol for the user's application.
S_OK | Success. |
ILS_E_POINTER | Address of the protocol interface is NULL, or the address request identifier is NULL. |
ILS_E_PARAMETER | No protocol by this name exists. |
ILS_E_FAIL | Could not remove protocol; user is in the middle of registration or unregistration. |
This method is an asynchronous operation. The application receives the IIlsUserNotify::ProtocolChangeResult notification for the request result.
HRESULT IIlsUser::SetExtendedAttribute(
BSTR bstrName,
BSTR bstrValue);
Adds or modifies an extended attribute of the user. The modification will not be reflected on the ILS server until the IIlsUser::Register or IIlsUser::Update method is called.
S_OK | Success. |
ILS_E_ACCESS_DENIED | User object is not writable. |
ILS_E_ACCESS_CONTROL | Attribute type is ILS_ATTRTYPE_NAME_ONLY. |
ILS_E_POINTER | Attribute name is NULL. |
ILS_E_PARAMETER | Attribute name is empty. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
HRESULT IIlsUser::SetGuid(
*pGuid);
Sets the GUID (globally unique identifier) of the User object. An application that creates the User object should insert its GUID in this property.
HRESULT IIlsUser::SetStandardAttribute(
ILS_STD_ATTR_NAME StdAttr,
BSTR bstrValue);
Allows the application to modify a standard attribute of the user. The modification will not be reflected on the ILS server until the IIlsUser::Register or IIlsUser::Update method is called.
S_OK | Success. |
ILS_E_ACCESS_DENIED | User object is not writable. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
ILS_E_PARAMETER | Attribute name is invalid. |
ILS_STDATTR_USER_ID | Unique identifier of the user. Must be specified at the time of User object creation. |
ILS_STDATTR_IP_ADDRESS | IP address of the user, specified as four octets specified in decimal; for example, "123.255.0.123". If this attribute is not set, the ILS interface automatically detects the network address and uses the found IP address. |
ILS_STDATTR_EMAIL_NAME | E-mail name of the user. |
ILS_STDATTR_FIRST_NAME | First name of the user. |
ILS_STDATTR_LAST_NAME | Last name of the user. |
ILS_STDATTR_CITY_NAME | Name of the city in which the user is located. |
ILS_STDATTR_COUNTRY_NAME | Name of the country in which the user is located. |
ILS_STDATTR_COMMENT | General textual comment. |
ILS_STDATTR_FLAGS | Flags to indicate the visibility of the User object on the server. Use IIlsUser::SetVisible to modify this flag. |
ILS_STDATTR_APP_NAME | Unique string identifying the application. Cannot set this attribute. Must be specified at the time of User object creation. |
ILS_STDATTR_APP_MIME_TYPE | MIME type used by the application. |
ILS_STDATTR_APP_GUID | GUID (globally unique identifier) of the application. |
ILS_STDATTR_PROTOCOL_NAME | Applies to the protocol object. |
ILS_STDATTR_PROTOCOL_MIME_TYPE | Applies to the protocol object. |
ILS_STDATTR_PROTOCOL_PORT | Applies to the protocol object. |
A user's email name is used his/her default user id (ILS_STDATTR_USER_ID) on the server. The ILS server enforces the uniqueness of this attribute.
NetMeeting uses two-letter country codes for ILS_STDATTR_COUNTRY_NAME.
ILS servers use Email name (ILS_STDATTR_EMAIL_NAME) and Country code (ILS_STDATTR_COUNTRY_NAME) as part of the full LDAP path on the server. As a result, these attributes cannot be modified using this method while the user is registered on the server. To modify these attributes, log off the server and create a new user object with the desired changes.
HRESULT IIlsUser::SetVisible(
DWORD fVisible);
Allows the application to modify the visibility state for the user. The modification will not be reflected on the ILS server until the IIlsUser::Register or IIlsUser::Update method is called.
HRESULT IIlsUser::Unregister(
ULONG *puReqID);
Removes the User object from the specified ILS server.
S_OK | Success. |
ILS_E_NOT_REGISTERED | This user is not registered on a server. |
ILS_E_ACCESS_DENIED | User object is read-only. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
This method is an asynchronous operation. The application receives the IIlsUserNotify::RegisterResult notification for the unregistration result.
It is not recommended to use this method if the registration is in progress (that is, the IIlsUser state is ILS_REGISTERING).
HRESULT IIlsUser::Update(
ULONG *puReqID);
Reflects updated user information to the ILS server.
S_OK | Success. |
S_FALSE | No modifications have been made; there is no need to update this user. |
ILS_E_NOT_REGISTERED | This user is not registered on a server. |
ILS_E_POINTER | Address of the request identifier is NULL. |
ILS_E_MEMORY | Unable to allocate enough memory for this request. |
This method is an asynchronous operation. The application receives the IIlsUserNotify::UpdateResult notification for the registration result.
The IConnectionPointContainer_IIlsUser interface is instantiated from IID_IConnectionPointContainer to identify User as a connectable object. The interface contains the standard set of methods for IConnectionPointContainer_IIlsUser.
The IConnectionPoint_IIlsUser interface is instantiated from IConnectionPointContainer_IIlsUser. The User object provides only one connection point—IID_IIlsUserNotify—for a client's sink object to receive the callback notification. The client must provide the IIlsUserNotify interface methods described in this section in the sink object.
This interface is implemented by a client application that will receive notifications from a User object.
EnumProtocolsResult |
GetProtocolResult |
ProtocolChangeResult |
RegisterResult |
StateChanged |
UpdateResult |
HRESULT IIlsUserNotify::EnumProtocolsResult(
ULONG uReqID,
IEnumIlsProtocol *pEnumProtocol,
HRESULT hResult);
Notifies the application of the result of the protocol enumeration request. If the request is successful, pEnumProtocol contains a valid protocol identification enumerator.
Back to IIlsUserNotify Interface
HRESULT IIlsUserNotify::GetProtocolResult(
ULONG uReqID,
IIlsProtocol *pProtocol,
HRESULT hResult);
Notifies the application of the result of the protocol resolve request. If the request is successful, pProtocol contains a valid Protocol object.
Back to IIlsUserNotify Interface
HRESULT IIlsUserNotify::ProtocolChangeResult(
ULONG uReqID,
HRESULT hResult);
Notifies the application of the result of the protocol add and remove requests. If the request is successful after registration, the information is propagated to the ILS server.
Back to IIlsUserNotify Interface
HRESULT IIlsUserNotify::RegisterResult(
ULONG uReqID,
HRESULT hResult);
Notifies the application of the result of the user register/unregister requests.
Back to IIlsUserNotify Interface
HRESULT IIlsUserNotify::StateChanged(
ULONG fPrimary,
BSTR bstrServerName);
Notifies the application when the server state for the User object has changed. When notified, the application should call IIlsUser::GetState for the new state information.
Back to IIlsUserNotify Interface
HRESULT IIlsUserNotify::UpdateResult(
ULONG uReqID,
HRESULT hResult);
Notifies the application of the result of the user update requests.
Back to IIlsUserNotify Interface
Last Updated: November 1, 1997
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.