• ExecMethod fails with 0x80041002 WBEM_E_NOT_FOUND

    From ermilindwalekar@gmail.com@21:1/5 to rmckee on Thu Apr 12 07:16:48 2018
    On Tuesday, October 28, 2008 at 8:34:08 PM UTC+5:30, rmckee wrote:
    The ExecMethod fails with 0x80041002 WBEM_E_NOT_FOUND only in Vista.
    The code works fine in XP.

    // set up to call the SystemRestore::Restore method
    BSTR MethodName = SysAllocString(L"Restore");
    BSTR ClassName = SysAllocString(L"SystemRestore");

    IWbemClassObject* pClass = NULL;
    hres = service->GetObject(ClassName, 0, NULL, &pClass, NULL);

    IWbemClassObject* pInParamsDefinition = NULL;
    hres = pClass->GetMethod(MethodName, 0, &pInParamsDefinition, NULL);

    IWbemClassObject* pClassInstance = NULL;
    hres = pInParamsDefinition->SpawnInstance(0, &pClassInstance);

    // Create the values for the in parameters
    VARIANT varCommand;
    varCommand.vt = VT_I4;
    varCommand.iVal = nRestoreSequenceNumber_;

    // Store the value for the in parameters
    hres = pClassInstance->Put(L"SequenceNumber", 0, &varCommand, 0);

    // Execute Method
    IWbemClassObject* pOutParams = NULL;
    hres = service->ExecMethod(ClassName, MethodName, 0, NULL, pClassInstance, &pOutParams, NULL);


    Any ideas what could be wrong?

    Thanks

    I have a problem with ExecMethod for Calling CreateSnapshot, My `pOutParams.ResultingSnapshot` is returned as NULL even when the snapshot/checkpoint is created. Any clue about this?

    Below is the text of pOutParams
    instance of __PARAMETERS
    {
    Job = "\\\\WIN-ADU8U45M3SN\\root\\virtualization\\v2:Msvm_ConcreteJob.InstanceID=\"FF983E2C-2BC4-4FF1-822B-93922290B631\"";
    ResultingSnapshot = NULL;
    ReturnValue = 4096;
    };
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)