4.2.3.2 Synchronous Delivery of IWbemServices PutInstance, DeleteInstance, and CreateInstanceEnum Operations
This section contains the information exchanged between SAI-NAV009 (client) and SAI-NAV009-2 (server).
On the server machine, the MOF shown below is compiled and made available to WMI.
-
#pragma namespace("\\\\.\\root\\cimv2\\MyTest") Class TestWMI { [key] uint32 x; uint32 y; };
First the client tries to connect to the server and obtains IWbemServices interface pointer for namespace root\cimv2\MyTest as outlined in 4.1.1. There is initially an instance of a TestWMI Class created on the server with (x=3,y=5).
Client calls PutInstance operation on IWbemServices interface pointer to create another instance of TestWMI class on the server. The instance property values are x=10, y=15:
-
- WMI: IWbemServices:PutInstance Request, Flags=0 + Inst: OBJREFCUSTOM - {DC12A681-737F-11CF-884D-00AA004B2E24} Pad: 0 Bytes + Flags: 0 (0x0) + Ctx: NULL + CallResult: NULL
Server returns WBEM_S_NO_ERROR. This implies that the instance above was successfully created on the server:
-
- WMI: IWbemServices:PutInstance Response, ReturnValue=WBEM_S_NO_ERROR + CallResult: NULL Pad: 0 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
Client calls CreateInstanceEnum operation on IWbemServices interface pointer:
-
- WMI: IWbemServices:CreateInstanceEnum Request, Flags=33 + StrFilter: TestWMI + Pad: 2 Bytes + Flags: 33 (0x21) + Ctx: NULL
In response to the method executed above, the server returns an IEnumWbemClassObject interface pointer:
-
- WMI: IWbemServices:CreateInstanceEnum Response, ReturnValue=WBEM_S_NO_ERROR + Enum: OBJREFSTANDARD - {027947E1-D731-11CE-A357-000000000001} + Pad: 2 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
The client uses IRemUnknown and IRemUnknown2, as specified in [MS-DCOM], to obtain an IWbemFetchSmartEnum interface pointer from the IEnumWbemClassObject interface pointer. From this the client would know if the server is optimized:
-
- DCOM: IRemUnknown2:RemQueryInterface Request, DCOM Version=5.7 Causality Id={BD28B839-5D20-4435-9852-1FE794070A9C} + HeaderReq: DCOM Version=5.7 Causality Id={BD28B839-5D20-4435-9852-1FE794070A9C} QueriedObjectIpId: {00026021-06C4-0000-9260-C0BCD4C240B3} PublicObjectReferenceCount: 5 (0x5) NumRequestedIIds: 1 (0x1) + Size: 1 Elements + InterfaceIds:
Server responds with a valid IWbemFetchSmartEnum interface pointer. This means that the server is optimized:
-
- DCOM: IRemUnknown2:RemQueryInterface Response, ORPCFNULL - No additional information in this packet + HeaderResp: ORPCFNULL - No additional information in this packet + RemqiresultPtr: Pointer To 0x00020000 + Size: 1 Elements + QueryInterfaceResults: + ReturnValue: Success
The client then calls the IWbemFetchSmartEnum::GetSmartEnum method to obtain the IWbemWCOSmartEnum interface pointer:
-
WMI: IWbemFetchSmartEnum:GetSmartEnum Request
Server responds with a valid IWbemWCOSmartEnum interface pointer:
-
- WMI: IWbemFetchSmartEnum:GetSmartEnum Response, ReturnValue=WBEM_S_NO_ERROR + SmartEnum: OBJREFSTANDARD - {423EC01E-2E35-11D2-B604-00104B703EFD} + Pad: 2 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
The client uses the IWbemWCOSmartEnum::Next method repeatedly to retrieve the IWbemClassObject interface pointers that contains the result set:
-
- WMI: IWbemWCOSmartEnum:Next Request, Timeout=0 UCount=10 proxyGUID: {DCFE7B7E-853F-494D-9EAD-FB96164158C1} Timeout: WBEM_NO_WAIT(Call returns immediately, regardless of whether any objects are available.) UCount: 10 (0xA)
Server responds with the result set containing 2 TestWMI instances. The instance property values are (x=3,y=5) and (x=10,y=15):
-
- WMI: IWbemWCOSmartEnum:Next Response, PuReturned=2 BuffSize=410 ReturnValue=WBEM_S_FALSE PuReturned: 2 (0x2) BuffSize: 410 (0x19A) + BufferPtrSize: Pointer To 0x00020000, 410 Elements + ObjectArray: + Pad: 2 Bytes
Client calls PutInstance operation on IWbemServices interface pointer on one of the TestWMI class instances (x=10, y=15) to update it to (x=10, y=20):
-
- WMI: IWbemServices:PutInstance Request, Flags=0 + Inst: OBJREFCUSTOM - {DC12A681-737F-11CF-884D-00AA004B2E24} Pad: 0 Bytes + Flags: 0 (0x0) + Ctx: NULL + CallResult: NULL
Server returns WBEM_S_NO_ERROR. This implies that the instance update above was successful on the server:
-
- WMI: IWbemServices:PutInstance Response, ReturnValue=WBEM_S_NO_ERROR + CallResult: NULL Pad: 0 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
Client calls DeleteInstance operation on IWbemServices interface pointer by providing the strObjectPath as \\SAI-NAV009-2\ROOT\cimv2\MyTest:TestWMI.x=10):
-
- WMI: IWbemServices:DeleteInstance Request, Flags=0 + StrObjectPath: \\SAI-NAV009-2\ROOT\cimv2\MyTest:TestWMI.x=10 + Pad: 2 Bytes Flags: Unknown + Ctx: NULL + CallResult: NULL
Server responds with success. This implies that TestWMI instance with key value as x=10 has been successfully deleted from the server:
-
- WMI: IWbemServices:DeleteInstance Response, ReturnValue=WBEM_S_NO_ERROR + CallResult: NULL Pad: 0 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
Client calls CreateInstanceEnum operation on IWbemServices interface pointer to find out the existing TestWMI instances on the server:
-
- WMI: IWbemServices:CreateInstanceEnum Request, Flags=33 + StrFilter: TestWMI + Pad: 2 Bytes + Flags: 33 (0x21) + Ctx: NULL
In response to the method executed above, the server returns an IEnumWbemClassObject interface pointer:
-
- WMI: IWbemServices:CreateInstanceEnum Response, ReturnValue=WBEM_S_NO_ERROR + Enum: OBJREFSTANDARD - {027947E1-D731-11CE-A357-000000000001} + Pad: 2 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
The client uses IRemUnknown and IRemUnknown2, as specified in [MS-DCOM], to obtain an IWbemFetchSmartEnum interface pointer from the IEnumWbemClassObject interface pointer. From this the client knows whether the server is optimized:
-
- DCOM: IRemUnknown2:RemQueryInterface Request, DCOM Version=5.7 Causality Id={BD28B839-5D20-4435-9852-1FE794070A9C} + HeaderReq: DCOM Version=5.7 Causality Id={BD28B839-5D20-4435-9852-1FE794070A9C} QueriedObjectIpId: {00004007-06C4-0000-99C1-96EC7361199B} PublicObjectReferenceCount: 5 (0x5) NumRequestedIIds: 1 (0x1) + Size: 1 Elements + InterfaceIds:
Server responds with a valid IWbemFetchSmartEnum interface pointer. This means that the server is optimized:
-
- DCOM: IRemUnknown2:RemQueryInterface Response, ORPCFNULL - No additional information in this packet + HeaderResp: ORPCFNULL - No additional information in this packet + RemqiresultPtr: Pointer To 0x00020000 + Size: 1 Elements + QueryInterfaceResults: + ReturnValue: Success
The client then calls the IWbemFetchSmartEnum::GetSmartEnum method to obtain the IWbemWCOSmartEnum interface pointer:
-
WMI: IWbemFetchSmartEnum:GetSmartEnum Request
Server responds with a valid IWbemWCOSmartEnum interface pointer:
-
- WMI: IWbemFetchSmartEnum:GetSmartEnum Response, ReturnValue=WBEM_S_NO_ERROR + SmartEnum: OBJREFSTANDARD - {423EC01E-2E35-11D2-B604-00104B703EFD} + Pad: 2 Bytes ReturnValue: 0x00000000 - WBEM_S_NO_ERROR - Indicates a successful completion to the method call.
The client uses the IWbemWCOSmartEnum::Next method repeatedly to retrieve the IWbemClassObject interface pointers that contain the result set:
-
- WMI: IWbemWCOSmartEnum:Next Request, Timeout=0 UCount=10 proxyGUID: {45CE1C5B-9841-4D4E-964D-BD5E03695B47} Timeout: WBEM_NO_WAIT(Call returns immediately, regardless of whether any objects are available.)
Server responds with the result set containing 1 TestWMI instance (x=3,y=5). This confirms that the other instance with x=10 has been successfully deleted as part of DeleteInstance call.
-
- WMI: IWbemWCOSmartEnum:Next Response, PuReturned=1 BuffSize=307 ReturnValue=WBEM_S_FALSE PuReturned: 1 (0x1) BuffSize: 307 (0x133) + BufferPtrSize: Pointer To 0x00020000, 307 Elements + ObjectArray: + Pad: 1 Bytes ReturnValue: 0x00000001 - WBEM_S_FALSE - Either no more CIM objects are available, the number of returned CIM objects is less than the number requested, or this is the end of an enumeration.