Ticket #5306: win32_api.patch
File win32_api.patch, 1.9 KB (added by , 12 years ago) |
---|
-
win32_api.hpp
1472 1472 ) 1473 1473 ) 1474 1474 { 1475 CoUninitialize(); 1475 1476 return false; 1476 1477 } 1477 1478 … … 1489 1490 { 1490 1491 pIWbemLocator->Release(); 1491 1492 1493 CoUninitialize(); 1492 1494 return false; 1493 1495 } 1494 1496 … … 1510 1512 pIWbemLocator->Release(); 1511 1513 pWbemServices->Release(); 1512 1514 1515 CoUninitialize(); 1513 1516 return false; 1514 1517 } 1515 1518 … … 1522 1525 pWbemServices->Release(); 1523 1526 pEnumObject->Release(); 1524 1527 1528 CoUninitialize(); 1525 1529 return false; 1526 1530 } 1527 1531 1528 1532 wchar_variant vwchar; 1529 1533 1530 while( 0 == pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned ) ) 1531 { 1532 if ( 0 == pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 ) ) 1533 { 1534 bRet = true; 1535 strValue = vwchar.value.pbstrVal; 1536 VariantClear(&vwchar ); 1537 break; 1538 } 1539 } 1534 while( 0 == pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned ) ) 1535 { 1536 if (pClassObject != 0) 1537 { 1538 if ( 0 == pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 ) ) 1539 { 1540 bRet = true; 1541 strValue = vwchar.value.pbstrVal; 1542 VariantClear(&vwchar ); 1543 break; 1544 } 1545 } 1546 } 1540 1547 1541 pIWbemLocator->Release(); 1542 pWbemServices->Release(); 1543 pEnumObject->Release(); 1544 pClassObject->Release(); 1548 if (pIWbemLocator != 0) 1549 pIWbemLocator->Release(); 1550 1551 if (pWbemServices != 0) 1552 pWbemServices->Release(); 1553 1554 if (pEnumObject != 0) 1555 pEnumObject->Release(); 1556 1557 if (pClassObject != 0) 1558 pClassObject->Release(); 1545 1559 } 1546 1560 1547 1561 CoUninitialize();