Advertisement

启动WMI提供器进程

阅读量:

使用WMI provider创建进程

复制代码
    #define _WIN32_DCOM
    #include <iostream>
    using namespace std;
    #include <comdef.h>
    #include <wbemidl.h>
    #pragma comment(lib, "wbemuuid.lib")
    void CreateClass(IWbemServices* pSvc);
    int main()
    {
    	HRESULT hr;
    	hr = CoInitializeEx(0, COINIT_MULTITHREADED);
    	if (FAILED(hr))
    	{
    		cout << "Failed to initialize COM library. Error code = 0x"
    			<< hex << hr << endl;
    		system("pause");
    	}
    	hr = CoInitializeSecurity(
    		NULL,                        // Security descriptor    
    		-1,                   

全部评论 (0)

还没有任何评论哟~