Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Wed, 16 Jul 2008 11:45:00 -0700,    group: microsoft.public.win32.programmer.wmi        back       


SystemRestore Disable problem (WMI) RSS   
Hi,

I have changed the example application (calling WMI provider) to call 
Disable method from SystemRestore. Problem is that it is not working...During 
ExecMethod I get 0x80041002 result all the time (it is the first error which 
is occuring in the code).

My code fragment:

    BSTR MethodName = SysAllocString(L"Disable");
    BSTR ClassName = SysAllocString(L"\\\\.\\root\\default:SystemRestore");

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

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

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

    VARIANT varCommand;
    varCommand.vt = VT_BSTR;   
    varCommand.bstrVal = L"D:\\";
   
    hres = pClassInstance->Put(L"Drive", 0,
        &varCommand, 0);
    wprintf(L"The command is: %s\n", V_BSTR(&varCommand));

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

Anyone knows what's wrong?

Best regards
Roman
date: Wed, 16 Jul 2008 11:45:00 -0700   author:   yoromv

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us