The Core Schema consists of the IANet_NetService class and the core event classes.
Purpose
The IANet_NetService class is the root object from the IANet_ schema. This class enables the client to access the sessions that are required to perform sets.
Instances
There is one instance of this object. The client should not rely on the key used for this class. Instead, the client should get the instance of the class by enumerating all instances of IANet_NetService.
Creating Instances
You cannot create instances of IANet_NetService.
Removing Instances
You cannot delete the instance of IANet_NetService.
Modifying Properties
There are no user-modifiable properties of this class.
Supported Attributes
This class implements two attributes:
Methods
The following methods can be used to manage sessions:
Purpose
This event is used to notify the client about the use of the NCS session API. Clients can use this event to be informed if other clients are creating or using sessions.
Triggers
This event is triggered when a client creates a session, deletes a session, or calls Apply for a session.
Event Data
The EventType can have one of the following values:
The SessionHandle contains the session handle that triggered the event.
OpenSessions contains the number of open sessions. This data item is NULL for the "Cache invalidated" and "Configuration changed" events.
Purpose
This event is used to notify the client that an internal error has occurred in the event
Providers. In some cases, this means that the event provider is not able to report further events.
Triggers
This event will occur:
Event Data
The EventType can be one of the following:
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.
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).
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.
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).
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.
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):
Copyright© 2002 Intel Corporation. Legal Information