8000 After the exception is caught here, does the program loop call, as in the example, cause a handle or memory leak · Issue #34 · Thomas-Sparber/wmi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
After the exception is caught here, does the program loop call, as in the example, cause a handle or memory leak #34
Open
@jijieming

Description

@jijieming

After the exception is caught here, does the program loop call, as in the example, cause a handle or memory leak:
int main(int /argc/, char */args/[])
{
try {
Win32_ComputerSystem computer = retrieveWmi<Win32_ComputerSystem>();
Win32_ComputerSystemProduct product = retrieveWmi<Win32_ComputerSystemProduct>();
SoftwareLicensingService liscense = retrieveWmi();
Win32_OperatingSystem os_info = retrieveWmi<Win32_OperatingSystem>();

        cout<<"Computername: "<<computer.Name<<" Domaind:"<<computer.Domain<<endl;
        cout<<"Product: "<<product.Name<<" UUID:"<<product.UUID<<endl;
        cout<<"Architecture: "<<os_info.OSArchitecture<<std::endl;
        cout<<"Roles: "<<endl;
        for(const string role : computer.Roles)
        {
            cout<<" - "<<role<<std::endl;
        }
        cout<<endl;
        cout<<"Installed services:"<<endl;
        for(const Win32_Service &service : retrieveAllWmi<Win32_Service>())
        {
            cout<<service.Caption<<endl;
        }
    } catch (const WmiException &ex) {
        cerr<<"Wmi error: "<<ex.errorMessage<<", Code: "<<ex.hexErrorCode()<<endl;
        return 1;
    }

    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0