Use cases – Dell Intel PRO Family of Adapters User Manual

Page 21

Advertising
background image

After the event provider gets an unknown event from an event source

After the software that provides the events has been shutdown

After the event provider gets an event but the event source cannot get further data about the event

Event Data

The EventType can be one of the following:

"Could not get event data". An event occurred, but the event source cannot get further data about the event.

"Event source has shut down". The data source for the event was shutdown. In this case, the event provider will also

be shutdown and no more events will be generated until the source is restarted and new notification queries are made.

"Unexpected message". The event provider received an unexpected event.

Back to Top

Use Cases

A session handle is required to change the configuration. The session handle allows the NCS software to manage

simultaneous multiple access to the configuration, thereby preventing a session from locking out all others. Each session has

a separate cache to store any changes that have been made. If there are multiple sessions making changes simultaneously

then the first to apply its changes will succeed. All other session caches will be invalidated.

Getting a Session Handle

The client must get the object path of the single instance of IANet_NetService before accessing the session handle. Call

IWbemServices::CreateInstanceEnum and pass the name of the class: IANet_NetService. This is equivalent to calling

IWbemServices::ExecQuery with the query SELECT * FROM IANet_NetService. Before making any changes to the

configuration, the client must get a session handle. Use the GetSesssionHandle method to start a fresh session.

The client can use IWbemServices::ExecMethod to execute a method on a CIM object and will need the object path, from

__PATH attribute of the instance of IANet_NetService. This method also returns the number of currently active sessions. The

client may want to issue a warning if it does not have exclusive access to the Network Configuration Service (NCS).

Using a Session Handle in the IWbemContext Object

After the client obtains a session handle, it must create an IWbemContext object. Store the session handle in the

SessionHandle qualifier of this object. A pointer to this COM object should be passed to every call into IWbemServices. The

session handle is not required when making calls to access the IANet_NetService object as this takes the handle as an explicit

argument.

Reading Pending Changes using a Session Handle

When reading the configuration, if you pass the session handle in the context, then the Providers will return the configuration

as if the pending updates were applied (e.g., uninstalled adapters will be missing and changed settings will return their new

values). However, some objects will not appear until Apply has been called (e.g., IANet_IPProtcolEndpoints will not be

created until the protocol has been bound to the appropriate miniport).

Finishing with a Session Handle

After changing the configuration, call the Apply method to commit the changes. This may return a follow-up action code

(e.g., reboot the system before the changes can take effect).

Always call the ReleaseSessionHandle after a session is finished, otherwise any changes made will be discarded. Calling the

Cancel method will also discard any changes made, but the client can continue to use the session handle as if it has just

been created.

Registering for the Core Events

Applications should use IWbemServices::ExecNotificationQuery or use IWbemServices:: ExecNotificationQueryAsync

to request event notification. The following queries are examples of event notification queries (this list is not exhaustive as

many queries are possible):

21

Advertising