From eebb49e64e29f54e7086cf1c8bff97578c420b96 Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Thu, 28 Jan 2021 14:56:54 +0100 Subject: [PATCH 1/3] Remove DMI --- OcsWmi/OcsWmi.cpp | 4 +- SysInfo/DMI.cpp | 775 --------------------------------- SysInfo/DMI.h | 102 ----- SysInfo/SysInfo.cpp | 40 +- SysInfo/SysInfo.h | 2 - TestSysInfo/TestSysInfoDlg.cpp | 210 --------- TestSysInfo/TestSysInfoDlg.h | 1 - 7 files changed, 5 insertions(+), 1129 deletions(-) delete mode 100644 SysInfo/DMI.cpp delete mode 100644 SysInfo/DMI.h diff --git a/OcsWmi/OcsWmi.cpp b/OcsWmi/OcsWmi.cpp index f476c9e6..353a1436 100644 --- a/OcsWmi/OcsWmi.cpp +++ b/OcsWmi/OcsWmi.cpp @@ -355,8 +355,8 @@ LPCTSTR COcsWmi::GetClassObjectStringValue(LPCTSTR lpstrProperty) { if(pType == 101) { - m_csResult = strCimValue( pVal, pType); - return m_csResult; + m_csResult = strCimValue( pVal, pType); + return m_csResult; } else { diff --git a/SysInfo/DMI.cpp b/SysInfo/DMI.cpp deleted file mode 100644 index 40e0f0cd..00000000 --- a/SysInfo/DMI.cpp +++ /dev/null @@ -1,775 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// DMI.cpp: implementation of the CDMI class. -// -// This code is derived from SMBIOS Peek code sample by wjfrancis -// http://www.codeproject.com/KB/system/SMBIOS_Peek.aspx -////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" - -#include "DebugLog.h" -#include "SysInfo.h" -#include "OcsWmi.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#define MAKEDWORD(a,b,c,d) ((d<<24)+(c<<16)+(b<<8)+(a)) - -CDMI::CDMI(void) -{ - m_pTables = NULL; -} - -CDMI::~CDMI(void) -{ - Disconnect(); -} - - -///////////////////////////////////////////////////////////////////////////// -// String - -LPCTSTR CDMI::DmiString(DmiHeader* dmi, UCHAR id) -{ - static CString cstr; - char *p = (char *)dmi; - - p += dmi->Length; - - if (id == 0) - return _T( ""); - - while(id > 1 && *p) - { - p += strlen(p); - p++; - id--; - } - // ASCII Filter - for(DWORD i = 0; i < strlen(p); i++){ - if(p[i] < 32 || p[i] == 127){ - p[i]='.'; - } - } - cstr = p; - return cstr; -} - -LPCTSTR CDMI::DmiStringB(BYTE b) -{ - static CString cstr; - cstr.Format( _T( "%d"), b); - return cstr; -} - -LPCTSTR CDMI::DmiStringW(WORD w) -{ - static CString cstr; - cstr.Format( _T( "%d"), w); - return cstr; -} - -LPCTSTR CDMI::DmiStringD(DWORD d) -{ - static CString cstr; - cstr.Format( _T( "%d"), d); - return cstr; -} - -LPCTSTR CDMI::DmiStringBX(BYTE b, DWORD type) -{ - static CString cstr; - switch (type) - { - case 0: - cstr.Format( _T( "%02Xh (%d)"), b, b); - break; - case 1: - cstr.Format( _T( "%02X"), b); - break; - case 2: - cstr.Format( _T( "%02Xh"), b); - break; - } - return cstr; -} - -LPCTSTR CDMI::DmiStringWX(WORD w, DWORD type) -{ - static CString cstr; - switch (type) - { - case 0: - cstr.Format( _T( "%04Xh (%d)"), w, w); - break; - case 1: - cstr.Format( _T( "%04X"), w); - break; - case 2: - cstr.Format( _T( "%04Xh"), w); - break; - case 3: - if(w >= 0xFFFE){ - cstr = NOT_AVAILABLE; - }else{ - cstr.Format( _T( "%04Xh"),w); - } - break; - } - return cstr; -} - -LPCTSTR CDMI::DmiStringDX(DWORD d, DWORD type) -{ - static CString cstr; - switch (type) - { - case 0: - cstr.Format( _T( "%08Xh (%d)"), d, d); - break; - case 1: - cstr.Format( _T( "%08X"), d); - break; - case 2: - cstr.Format( _T( "%08Xh"), d); - break; - } - return cstr; -} - -BOOL CDMI::CheckSum(const BYTE *buf, int length) -{ - BYTE sum = 0; - - for(int i = 0; i < length; i++){ - sum += buf[i]; - } - return (sum==0); -} - -BOOL CDMI::Connect( LPCTSTR lpstrDevice) -{ - VARIANT variantBiosData; - COcsWmi dllWMI; - CString csCimRoot; - - // Connect to the root\WMI namespace - AddLog( _T( "DMI Connect: Trying to connect to WMI namespace root\\WMI on device <%s>...\n"), - (lpstrDevice == NULL ? _T( "Localhost") : lpstrDevice)); - if (lpstrDevice == NULL) - csCimRoot.Format( _T( "root\\WMI")); - else - csCimRoot.Format( _T( "\\\\%s\\root\\WMI"), lpstrDevice); - if (!dllWMI.ConnectWMI( csCimRoot)) - { - // Unable to connect to WMI => no WMI support - AddLog( _T( "\tFailed because unable to connect to WMI namespace (0x%lX) !\n"), dllWMI.GetLastErrorWMI()); - return FALSE; - } - AddLog( _T( "\tOK\nDMI Connect: Trying to get raw SMBios data...\n")); - // Enumerates MSSMBios_RawSMBiosTables objects - if (!dllWMI.BeginEnumClassObject( _T("MSSMBios_RawSMBiosTables"))) - { - AddLog( _T( "\tFailed because no MSSMBios_RawSMBiosTables object !\n")); - return FALSE; - } - VariantInit( &variantBiosData); - while (dllWMI.MoveNextEnumClassObject()) - { - // This an object, ensure SMBios data are ok - // Try to get SMBios version - if ((m_nSMBiosVersionMajor = dllWMI.GetClassObjectDwordValue( _T( "SmbiosMajorVersion"))) == 0) - { - // No SMBios version, skip this object - continue; - } - if ((m_nSMBiosVersionMajor = dllWMI.GetClassObjectDwordValue( _T( "SmbiosMinorVersion"))) == 0) - { - // No SMBios version, skip this object - continue; - } - // Try to get DMI tables - VariantClear( &variantBiosData); - if (!dllWMI.GetClassObjectVariantValue( _T( "SMBiosData"), variantBiosData)) - { - // No SMBios version, skip this object - VariantClear( &variantBiosData); - continue; - } - if (variantBiosData.vt == (VT_UI1 | VT_ARRAY)) - { - // SMBios data inside - SAFEARRAY* p_array = NULL; - p_array = V_ARRAY(&variantBiosData); - unsigned char* p_data = (unsigned char *)p_array->pvData; - - m_nStructureLength = p_array->rgsabound[0].cElements; - if (m_pTables != NULL) - free( m_pTables); - if ((m_pTables = (UCHAR*) malloc( m_nStructureLength+2)) == NULL) - { - AddLog( _T( "\tUnable to allocate memory for raw SMBIOS data !\n")); - return FALSE; - } - memset( m_pTables, 0, m_nStructureLength+2); - // OK, we've found them - memcpy( m_pTables, p_data, m_nStructureLength); - SafeArrayDestroy( p_array); - break; - } - // Not already found, enumerate next object - } - dllWMI.DisconnectWMI(); - // Release used WMI objects - if (m_pTables == NULL) - { - AddLog( _T( "\tNo MSSMBios_RawSMBiosTables found !\n")); - return FALSE; - } - AddLog( _T( "\tOK\n")); - return TRUE; -} - -BOOL CDMI::IsConnected() -{ - return (m_pTables != NULL); -} - -BOOL CDMI::Disconnect() -{ - AddLog( _T( "DMI: Unload DMI tables...\n")); - if (m_pTables != NULL) - { - free( m_pTables); - m_pTables = NULL; - } - return TRUE; -} - -int CDMI::GetTableLength( int nPosition) -{ - DmiHeader *dmi; - int nLength = 0; - - // Ensure this is a valid table type - dmi = (DmiHeader*) &m_pTables[ nPosition]; -/* There is now DMI table type greater than 127, so remove type lower and upper bound check - if ((dmi->Type < 0) || (dmi->Type > 127)) - return 0; // error -*/ - // Fixed table size is in DMI header, but we need to find variable table size - // where strings are stored (ending with 2 '\0' characters) - nLength = dmi->Length; - while ((nPosition + nLength) < m_nStructureLength) - { - if ((m_pTables[ nPosition+nLength]==0) && - (m_pTables[ nPosition+nLength+1]==0)) - { - return nLength+2; - } - nLength++; - } - // No variable part end found - nLength = dmi->Length; - return nLength; -} - -UCHAR *CDMI::GetNextTable( UCHAR uType, BOOL bStart) -{ - static int nPosition; // To store position betwwen 2 calls - int nIndex, nLength; - DmiHeader *dmi; - - if (bStart) - // Search from beginning of tables - nPosition = 0; - - while (nPosition < m_nStructureLength) - { - dmi = (DmiHeader*) &m_pTables[ nPosition]; - // Get table length - nLength = GetTableLength( nPosition); - // Save current table position - nIndex = nPosition; - // Set position of next table - nPosition += nLength; - // Check current table type - if (dmi->Type == uType) - { - // This is one table we search - return &m_pTables[ nIndex]; - } - // No more table to parse - if (nLength == 0) - break; - } - // Not found - return NULL; -} - - -BOOL CDMI::GetBiosInfo( CBios *pMyBios) -{ - CString csVendor, - csVersion, - csDate, - csManufacturer, - csModel, - csSN, - csType, - csAssetTag; - - pMyBios->Set( NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE, NOT_AVAILABLE); - // First, get BIOS Info - if (!GetBios( csVendor, csVersion, csDate)) - return FALSE; - pMyBios->SetBiosManufacturer( csVendor); - pMyBios->SetBiosVersion( csVersion); - pMyBios->SetBiosDate( csDate); - // Try general system info - if (GetSystemInformation( csManufacturer, csModel, csSN)) - { - pMyBios->SetSystemManufacturer( csManufacturer); - pMyBios->SetSystemModel( csModel); - pMyBios->SetSystemSerialNumber( csSN); - } - // Try system enclosure - if (GetSystemEnclosure( csManufacturer, csType, csSN, csAssetTag)) - { - if (!pMyBios->IsValidSystemManufacturer()) - pMyBios->SetSystemManufacturer( csManufacturer); - if (!pMyBios->IsValidSystemSerialNumber()) - pMyBios->SetSystemSerialNumber( csSN); - pMyBios->SetMachineType( csType); - pMyBios->SetAssetTag( csAssetTag); - } - // Try baseboard - if (GetBaseBoard( csManufacturer, csModel, csVersion, csSN, csAssetTag)) - { - if (!pMyBios->IsValidAssetTag()) - pMyBios->SetAssetTag( csAssetTag); - if (!pMyBios->IsValidSystemManufacturer()) - pMyBios->SetSystemManufacturer( csManufacturer); - if (!pMyBios->IsValidSystemModel()) - pMyBios->SetSystemModel( csModel); - pMyBios->SetMotherboardManufacturer( csManufacturer); - pMyBios->SetMotherboardModel( csModel); - pMyBios->SetMotherboardSerialNumber( csSN); - } - return TRUE; -} - -BOOL CDMI::GetBios( CString &csVendor, CString &csVersion, CString &csDate) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - - if (m_pTables == NULL) - return FALSE; - AddLog( _T( "DMI GetBios: Trying to find DMI Structure type 0...\n")); - // 00 BIOS Information - pPointer = GetNextTable( DMI_BIOS_INFORMATION, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - csVendor = DmiString(dmi, pPointer[0x04]); - csVersion = DmiString(dmi, pPointer[0x05]); - csDate = DmiString(dmi, pPointer[0x08]); - AddLog( _T( "\t\t\n"), - csVendor, csVersion, csDate); - uCount++; - // next - pPointer = GetNextTable( DMI_BIOS_INFORMATION); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetSystemInformation( CString &csVendor, CString &csModel, CString &csSN) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - - if (m_pTables == NULL) - return FALSE; - AddLog( _T( "DMI GetSystemInformation: Trying to find DMI Structure type 1...\n")); - // 01 System Information - pPointer = GetNextTable( DMI_SYSTEM_INFORMATION, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - csVendor = DmiString(dmi, pPointer[0x04]); - csModel = DmiString(dmi, pPointer[0x05]); - csSN = DmiString(dmi, pPointer[0x07]); - AddLog( _T( "\t\t\n"), - csVendor, csModel, csSN); - uCount++; - // next - pPointer = GetNextTable( DMI_SYSTEM_INFORMATION); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetBaseBoard( CString &csVendor, CString &csProduct, CString &csVersion, CString &csSN, CString &csAssetTag) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - - if (m_pTables == NULL) - return FALSE; - AddLog( _T( "DMI GetBaseBoard: Trying to find DMI Structure type 2...\n")); - // 02 Base Board Information - pPointer = GetNextTable( DMI_BASEBOARD_INFORMATION, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - csVendor = DmiString(dmi, pPointer[0x04]); - csProduct = DmiString(dmi, pPointer[0x05]); - csVersion = DmiString(dmi, pPointer[0x06]); - csSN = DmiString(dmi, pPointer[0x07]); - if(pPointer[0x02] > 8) - { - // Asset tag is stored here - csAssetTag = DmiString(dmi, pPointer[0x08]); - } - AddLog( _T( "\t\t\n"), - csVendor, csProduct, csVersion, csSN, csAssetTag); - uCount++; - // next - pPointer = GetNextTable( DMI_BASEBOARD_INFORMATION); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetSystemEnclosure( CString &csVendor, CString &csType, CString &csSN, CString &csAssetTag) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - - if (m_pTables == NULL) - return FALSE; - AddLog( _T( "DMI GetSystemEnclosure: Trying to find DMI Structure type 3...\n")); - // 03 System Enclosure or Chassis - pPointer = GetNextTable( DMI_SYSTEM_ENCLOSURE, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - csVendor = DmiString(dmi, pPointer[0x04]); - csSN = DmiString(dmi, pPointer[0x07]); - csAssetTag = DmiString(dmi, pPointer[0x08]); - csType = CBios::ParseChassisType( pPointer[0x05] & 0x7f); - uCount++; - AddLog( _T( "\t\t\n"), - csVendor, csType, csSN, csAssetTag); - // next - pPointer = GetNextTable( DMI_SYSTEM_ENCLOSURE); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetSystemPorts( CSystemPortList *pMyList) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - CSystemPort myObject; - CString csBuffer; - - ASSERT( pMyList); - - if (m_pTables == NULL) - return FALSE; - - AddLog( _T( "DMI GetSystemPorts: Trying to find DMI Structure type 8...\n")); - // Reset object list content - pMyList->RemoveAll(); - // 08 Port Connector Information - pPointer = GetNextTable( DMI_SYSTEM_PORTS, TRUE); - while( pPointer != NULL) - { - myObject.Clear(); - dmi = (DmiHeader*) pPointer; - // External reference designator - myObject.SetName( DmiString(dmi, pPointer[0x06])); - // Port type - myObject.SetType( pPointer[0x08]); - // External connector type - myObject.SetConnectorType( pPointer[0x07]); - csBuffer.Format( _T( "%s %s"), myObject.GetName(), myObject.GetDescription()); - myObject.SetCaption( csBuffer); - pMyList->AddTail( myObject); - AddLog( _T( "\t\t\n"), - myObject.GetName(), myObject.GetType(), myObject.GetCaption(), myObject.GetDescription()); - // next - uCount++; - pPointer = GetNextTable( DMI_SYSTEM_PORTS); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetSystemSlots( CSystemSlotList *pMyList) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - CSystemSlot myObject; - CString csBuffer, - csWidth; - - ASSERT( pMyList); - - if (m_pTables == NULL) - return FALSE; - - AddLog( _T( "DMI GetSystemSlots: Trying to find DMI Structure type 9...\n")); - // Reset object list content - pMyList->RemoveAll(); - // 09 System Slots - pPointer = GetNextTable( DMI_SYSTEM_SLOTS, TRUE); - while( pPointer != NULL) - { - myObject.Clear(); - dmi = (DmiHeader*) pPointer; - // Slot designation - myObject.SetSlotDesignation( DmiString(dmi, pPointer[0x04])); - myObject.SetName( DmiString(dmi, pPointer[0x04])); - // Slot type - myObject.SetType( pPointer[0x05]); - // Data Bus Width - myObject.SetBusWidth( pPointer[0x06]); - // Usage - myObject.SetUsage( pPointer[0x07]); - pMyList->AddTail( myObject); - AddLog( _T( "\t\t\n"), - myObject.GetName(), myObject.GetSlotDesignation(), myObject.GetDescription()); - // next - uCount++; - pPointer = GetNextTable( DMI_SYSTEM_SLOTS); - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - return (uCount > 0); -} - -BOOL CDMI::GetMemorySlots( CMemorySlotList *pMyList) -{ - DmiHeader *dmi; - UCHAR *pPointer; - UINT uCount = 0; - CMemorySlot myObject; - CString csBuffer; - DWORD dwValue, - dwUse, - dwECC; - POSITION pPosCur, - pPosNext; - - ASSERT( pMyList); - - if (m_pTables == NULL) - return FALSE; - - AddLog( _T( "DMI GetMemorySlots: Trying to find DMI Structure type 17...\n")); - // Reset object list content - pMyList->RemoveAll(); - // 17 Memory Device - pPointer = GetNextTable( DMI_MEMORY_DEVICE, TRUE); - while( pPointer != NULL) - { - myObject.Clear(); - dmi = (DmiHeader*) pPointer; - uCount++; - myObject.SetSlotNumber( uCount); - // Bank locator - myObject.SetDescription( DmiString(dmi, pPointer[0x11])); - if (_tcslen( myObject.GetDescription()) == 0) - // Device Locator - myObject.SetDescription( DmiString(dmi, pPointer[0x10])); - // Size - WORD wCapacity = MAKEWORD(pPointer[0x0C], pPointer[0x0D]); - if (wCapacity == 0) - csBuffer = _T( "0"); - else if (wCapacity == 0xFFFF) - // Not available, wrong number - csBuffer = NOT_AVAILABLE; - else if ((wCapacity >> 15) & 0x1) - // Size is in KB - csBuffer = _T( "< 1"); - else - { - // Size is in MB - csBuffer.Format( _T( "%u"), (wCapacity & 0x7FFF)); - } - myObject.SetCapacity( csBuffer); - // Type - myObject.SetType( pPointer[0x12]); - // Speed - csBuffer.Format( _T( "%u"), MAKEWORD( pPointer[0x15], pPointer[0x16])); - myObject.SetSpeed( csBuffer); - // Manufacturer -// csBuffer = DmiString(dmi, pPointer[0x17]); - // Serial Number - csBuffer = DmiString(dmi, pPointer[0x18]); -/* // If S/N is empty, get Part number - if (csBuffer.IsEmpty()) - csBuffer = DmiString(dmi, pPointer[0x1A]); -*/ - if ((wCapacity > 0) && myObject.IsValidSN( csBuffer)) - myObject.SetSN( csBuffer); - pMyList->AddTail( myObject); - AddLog( _T( "\t\t\n"), - myObject.GetCaption(), myObject.GetDescription(), myObject.GetSlotNumber(), myObject.GetCapacity(), - myObject.GetSpeed(), myObject.GetType(), myObject.GetSN()); - // next - pPointer = GetNextTable( DMI_MEMORY_DEVICE); - } - if (uCount == 0) - { - AddLog( _T( "\tFailed because no DMI Structure type 17 !\n")); - return FALSE; - } - AddLog( _T( "\tOK (%u objects)\n"), uCount); - // Add information from Memory Array - AddLog( _T( "DMI GetMemorySlots: Trying to find DMI Structure type 16...\n")); - pPosNext = pMyList->GetHeadPosition(); - pPosCur = pMyList->GetHeadPosition(); - UINT nbFilled = uCount; - uCount = 0; - // 16 Physical Memory Array - pPointer = GetNextTable( DMI_MEMORY_ARRAY, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - // Number of memory slot in this array - dwValue = MAKEWORD( pPointer[0x0D], pPointer[0x0E]); - while( nbFilled < dwValue ) { - myObject.SetCaption( _T("")); - myObject.SetDescription( _T("")); - myObject.SetCapacity( _T("0")); - myObject.SetSlotNumber( nbFilled+1 ); - myObject.SetSpeed( _T("")); - myObject.SetType( _T("Empty slot")); - pMyList->AddTail( myObject); - nbFilled++; - } - // Usage - dwUse = pPointer[0x05]; - // ECC type - dwECC = pPointer[0x06]; - // Each properties of Physical Memory Array have to be set in MemorySlot object - // corresponding to current array - if (pPosNext != NULL) - myObject = pMyList->GetNext( pPosNext); - while ((pPosCur != NULL) && (myObject.GetSlotNumber() <= (uCount+dwValue))) - { - myObject.SetUsage( dwUse); - myObject.SetCaption( myObject.GetUsage()); - if (_tcscmp( myObject.GetType(), _T("Empty slot")) != 0) - myObject.SetTypeECC( dwECC); - if (_tcscmp( myObject.GetCapacity(), _T("0")) == 0) - myObject.SetType( _T("Empty slot")); - pMyList->SetAt( pPosCur, myObject); - pPosCur = pPosNext; - if (pPosNext != NULL) - myObject = pMyList->GetNext( pPosNext); - } - uCount += dwValue; - // next - pPointer = GetNextTable( DMI_MEMORY_ARRAY); - } - AddLog( _T( "\tOK (%u objects updated)\n"), uCount); - return (uCount > 0); -} - - -BOOL CDMI::GetUUID( CString &csUUID) -{ - DmiHeader *dmi; - UCHAR *pPointer, - *pUUID; - UINT uCount = 0; - BOOL bOnly0xFF = TRUE, - bOnly0x00 = TRUE; - - if (m_pTables == NULL) - return FALSE; - AddLog( _T( "DMI GetUUID: Trying to find DMI Structure type 1...\n")); - // 01 System Information - pPointer = GetNextTable( DMI_SYSTEM_INFORMATION, TRUE); - while( pPointer != NULL) - { - dmi = (DmiHeader*) pPointer; - // Ensure there is a UUID - if (dmi->Length >= 0x19) - { - // UUID is at offset 0x08 - pUUID = pPointer + 0x08; - // Ensure UUID (16 byte long) is available - for (int i = 0; i < 16 && (bOnly0x00 || bOnly0xFF); i++) - { - if (pUUID[i] != 0x00) - bOnly0x00 = FALSE; - if (pUUID[i] != 0xFF) - bOnly0xFF = FALSE; - } - - if (bOnly0xFF) - { - csUUID = _T( "Not Present"); - break; - } - if (bOnly0x00) - { - csUUID = _T("Not Settable"); - break; - } - - /* - * As of version 2.6 of the SMBIOS specification, the first 3 - * fields of the UUID are supposed to be encoded on little-endian. - * The specification says that this is the defacto standard, - * however I've seen systems following RFC 4122 instead and use - * network byte order, so I am reluctant to apply the byte-swapping - * for older versions. - */ - if ((m_nSMBiosVersionMajor > 2) ||(m_nSMBiosVersionMajor == 2) && (m_nSMBiosVersionMinor >= 6)) - csUUID.Format( _T( "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X"), - pUUID[3], pUUID[2], pUUID[1], pUUID[0], pUUID[5], pUUID[4], pUUID[7], pUUID[6], - pUUID[8], pUUID[9], pUUID[10], pUUID[11], pUUID[12], pUUID[13], pUUID[14], pUUID[15]); - else - csUUID.Format( _T("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X"), - pUUID[0], pUUID[1], pUUID[2], pUUID[3], pUUID[4], pUUID[5], pUUID[6], pUUID[7], - pUUID[8], pUUID[9], pUUID[10], pUUID[11], pUUID[12], pUUID[13], pUUID[14], pUUID[15]); - - AddLog( _T( "\t\t\n"), m_nSMBiosVersionMajor, m_nSMBiosVersionMinor, csUUID); - uCount++; - } - // next - pPointer = GetNextTable( DMI_SYSTEM_INFORMATION); - } - if (uCount > 0) - AddLog( _T( "\tOK (%u objects)\n")); - else - AddLog( _T( "\tFailed because no DMI Structure type 1 !\n")); - return (uCount > 0); -} diff --git a/SysInfo/DMI.h b/SysInfo/DMI.h deleted file mode 100644 index 65d62758..00000000 --- a/SysInfo/DMI.h +++ /dev/null @@ -1,102 +0,0 @@ -//==================================================================================== -// Open Computer and Software Inventory Next Generation -// Copyright (C) 2010 OCS Inventory Team. All rights reserved. -// Web: http://www.ocsinventory-ng.org - -// This code is open source and may be copied and modified as long as the source -// code is always made freely available. -// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt -//==================================================================================== - -// DMI.h: interface for the CDMI class. -// -// This code is derived from SMBIOS Peek code sample by wjfrancis -// http://www.codeproject.com/KB/system/SMBIOS_Peek.aspx -////////////////////////////////////////////////////////////////////// - -#ifndef _DMI_HEADER_INCLUDED_ -#define _DMI_HEADER_INCLUDED_ - -#pragma once - -#include "SysInfoClasses.h" - -// See DMTF standard SMBios specification reference -// Currently, version 2.6.1 is supported (see DSP0134_2.6.1.pdf) -// -// As field values are used either from DMI tables or WMI, -// methods to associate strings to numerical value are defined in components -// classes (CSystemSlot, CSystemPort...) - -// Header of one DMI table -typedef struct _DmiHeader -{ - UCHAR Type; - UCHAR Length; - WORD Handle; -}DmiHeader; - -// Supported DMI table types -#define DMI_BIOS_INFORMATION 0 -#define DMI_SYSTEM_INFORMATION 1 -#define DMI_BASEBOARD_INFORMATION 2 -#define DMI_SYSTEM_ENCLOSURE 3 -#define DMI_SYSTEM_PORTS 8 -#define DMI_SYSTEM_SLOTS 9 -#define DMI_MEMORY_ARRAY 16 -#define DMI_MEMORY_DEVICE 17 - -class SYSINFO_API CDMI -{ -public: - CDMI(void); - ~CDMI(void); - - ////////////////////////////////// - // Connection methods - ////////////////////////////////// - BOOL Connect( LPCTSTR lpstrDevice = NULL); - BOOL IsConnected(); - BOOL Disconnect(); - - // Get information from DMI tables - BOOL GetBiosInfo( CBios *pMyBios); - BOOL GetBios( CString &csVendor, CString &csVersion, CString &csDate); - BOOL GetSystemInformation( CString &csVendor, CString &csModel, CString &csSN); - BOOL GetBaseBoard( CString &csVendor, CString &csProduct, CString &csVersion, CString &csSN, CString &csAssetTag); - BOOL GetSystemEnclosure( CString &csVendor, CString &csType, CString &csSN, CString &csAssetTag); - BOOL GetSystemPorts( CSystemPortList *pMyList); - BOOL GetSystemSlots( CSystemSlotList *pMyList); - BOOL GetMemorySlots( CMemorySlotList *pMyList); - BOOL GetUUID( CString &csUUID); - -protected: - // Get string from DMI table field id - LPCTSTR DmiString(DmiHeader* dmi, UCHAR id); - // Get string from BYTE, WORD or DWORD value - LPCTSTR DmiStringB(BYTE b); - LPCTSTR DmiStringW(WORD w); - LPCTSTR DmiStringD(DWORD d); - // Get string with hex value from BYTE, WORD or DWORD value - // Type 1 = format %04Xh (%d), type 2 = %04X, type 3 = %04Xh - LPCTSTR DmiStringBX(BYTE b, DWORD type = 0); - LPCTSTR DmiStringWX(WORD w, DWORD type = 0); - LPCTSTR DmiStringDX(DWORD d, DWORD type = 0); - // Verify SMBios header checksum - BOOL CheckSum(const BYTE *buf, int length); - // Get length of DMI table at position nPosition - int GetTableLength( int nPosition); - // Get next DMI table of type uType, and start searching from beginning - // of table, or from current position - UCHAR *GetNextTable( UCHAR uType, BOOL bStart = FALSE); - -protected: - // Raw SMBios data - UCHAR *m_pTables; - // Raw SMBios data length - int m_nStructureLength; - // SMBios Version - int m_nSMBiosVersionMajor, m_nSMBiosVersionMinor; -}; - -#endif // _DMI_HEADER_INCLUDED_ diff --git a/SysInfo/SysInfo.cpp b/SysInfo/SysInfo.cpp index 555f84a3..ccc54995 100644 --- a/SysInfo/SysInfo.cpp +++ b/SysInfo/SysInfo.cpp @@ -58,7 +58,6 @@ CSysInfo::CSysInfo( BOOL bEnableLog, LPCTSTR lpstrFolder) OpenLog( lpstrFolder); GetSystemInfo( &m_SystemInfo); m_wmiInfo.Connect(); - m_dmiInfo.Connect(); m_registryInfo.Connect(); m_dwAddressWidth = 0; } @@ -67,7 +66,6 @@ CSysInfo::~CSysInfo() { // Nothing to do yet m_wmiInfo.Disconnect(); - m_dmiInfo.Disconnect(); m_registryInfo.Disconnect(); CloseLog(); } @@ -488,10 +486,7 @@ DWORD CSysInfo::getAddressWidthOS() BOOL CSysInfo::getSystemPorts( CSystemPortList *pMyList) { - // First, try SMBios/DMI - if (m_dmiInfo.GetSystemPorts( pMyList)) - return TRUE; - // Next, try WMI + // First, try WMI if (m_wmiInfo.GetSystemPorts( pMyList)) return TRUE; // Last, use registry @@ -554,23 +549,6 @@ BOOL CSysInfo::getMemorySlots( CMemorySlotList *pMyList) CMemory memoryInfo; ULONGLONG ulTotalSlot, ulTotalRAM; - // First, try SMBios/DMI - if (m_dmiInfo.GetMemorySlots( pMyList)) - { - ulTotalSlot = pMyList->GetTotalMemory(); - ulTotalRAM = memoryInfo.getTotalRAM() / ONE_MEGABYTE; - - // 32 bits Windows OS can only use 3235 MB max - if ((getAddressWidthOS() < 64) && (ulTotalSlot > 3235)) - // More than 3 GB memory on 32 bits OS, so assume result is OK - return TRUE; - // 64 bits OS od less than 3 GB on 32 bits OS - // Try to check if part of memory is used by video, either less than 128 MB or less than 15% - if (((ulTotalSlot - ulTotalRAM) < 128) || ((ulTotalSlot - ulTotalRAM) < (ulTotalRAM/15))) - // DMI query seems OK - return TRUE; - } - // Last try WMI return m_wmiInfo.GetMemorySlots( pMyList); } @@ -636,21 +614,12 @@ BOOL CSysInfo::getStoragePeripherals( CStoragePeripheralList *pMyList) BOOL CSysInfo::getSystemSlots( CSystemSlotList *pMyList) { - // First, try SMBios/DMI - if (m_dmiInfo.GetSystemSlots( pMyList)) - return TRUE; - // Last, try WMI return m_wmiInfo.GetSystemSlots( pMyList); } BOOL CSysInfo::getBiosInfo( CBios *pMyBios) { - // First, try SMBios/DMI - if (m_dmiInfo.GetBiosInfo( pMyBios) && - pMyBios->IsValidSystemSerialNumber() && - pMyBios->IsValidSystemModel()) - return TRUE; - // Next, try WMI + // First, try WMI if (m_wmiInfo.GetBiosInfo( pMyBios)) return TRUE; // Last, try registry @@ -940,9 +909,6 @@ BOOL CSysInfo::getWindowsProductKey(CString &productKey) BOOL CSysInfo::getUUID( CString &csUUID) { - // First, try SMBios/DMI - if (m_dmiInfo.GetUUID( csUUID)) - return TRUE; - // Last, use WMI + // Use WMI to retrieve UUID return m_wmiInfo.GetUUID( csUUID); } diff --git a/SysInfo/SysInfo.h b/SysInfo/SysInfo.h index 6834d251..ae3dfd25 100644 --- a/SysInfo/SysInfo.h +++ b/SysInfo/SysInfo.h @@ -66,7 +66,6 @@ #include "Registry.h" #include "Wmi.h" #include "EDID.h" -#include "DMI.h" #include "VMSystem.h" // CSysInfoApp @@ -153,7 +152,6 @@ class SYSINFO_API CSysInfo protected: // Attributes SYSTEM_INFO m_SystemInfo; // System information CWmi m_wmiInfo; // Class to get information from WMI - CDMI m_dmiInfo; // Class to get information from SMBIOS/DMI CRegistry m_registryInfo; // Class to get information from registry CWindowsSocket m_Sock; // Class to get information from Windows Sockets DWORD m_dwAddressWidth;// OS Address Width (32, 64 bits) diff --git a/TestSysInfo/TestSysInfoDlg.cpp b/TestSysInfo/TestSysInfoDlg.cpp index c7cd040f..1f5ab896 100644 --- a/TestSysInfo/TestSysInfoDlg.cpp +++ b/TestSysInfo/TestSysInfoDlg.cpp @@ -48,7 +48,6 @@ BEGIN_MESSAGE_MAP(CTestSysInfoDlg, CDialog) ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP - ON_BN_CLICKED(IDC_SMBIOS, &CTestSysInfoDlg::OnBnClickedSmbios) ON_BN_CLICKED(IDC_WMI, &CTestSysInfoDlg::OnBnClickedWmi) ON_BN_CLICKED(IDC_SYSINFO, &CTestSysInfoDlg::OnBnClickedSysinfo) ON_BN_CLICKED(IDC_LOAD_XML, &CTestSysInfoDlg::OnBnClickedLoadXml) @@ -129,215 +128,6 @@ void CTestSysInfoDlg::SysInfoLog (CString str) m_List.AddString( str); } -/************************************************************************************/ -/************************************************************************************/ -/************************************************************************************/ -/* - * - * - * SMBIOS - * - * - * -/************************************************************************************/ -/************************************************************************************/ -/************************************************************************************/ -void CTestSysInfoDlg::OnBnClickedSmbios() -{ - // TODO: Add your control notification handler code here - CWaitCursor cWait; - CDMI myDMI; - CString csVendor, - csVersion, - csDate, - csModel, - csSN, - csType, - csAssetTag, - str; - POSITION pos; - BOOL bContinue; - - m_List.ResetContent(); - if (myDMI.Connect()) - m_List.AddString( _T( "Connected to DMI")); - else - { - m_List.AddString( _T( "Error connecting to DMI")); - return ; - } - m_List.AddString( _T( "------------------------------------------------------")); - m_List.AddString( _T( "BIOS info")); - m_List.AddString( _T( "------------------------------------------------------")); - myDMI.GetBios( csVendor, csVersion, csDate); - str.Format( _T( "Vendor: %s"), csVendor); - m_List.AddString( str); - str.Format( _T( "Version: %s"), csVersion); - m_List.AddString( str); - str.Format( _T( "Date: %s"), csDate); - m_List.AddString( str); - - m_List.AddString( _T( "")); - m_List.AddString( _T( "------------------------------------------------------")); - m_List.AddString( _T( "System info")); - m_List.AddString( _T( "------------------------------------------------------")); - myDMI.GetSystemInformation( csVendor, csModel, csSN); - str.Format( _T( "Vendor: %s"), csVendor); - m_List.AddString( str); - str.Format( _T( "Model: %s"), csModel); - m_List.AddString( str); - str.Format( _T( "S/N: %s"), csSN); - m_List.AddString( str); - - m_List.AddString( _T( "")); - m_List.AddString( _T( "------------------------------------------------------")); - m_List.AddString( _T( "Base Board info")); - m_List.AddString( _T( "------------------------------------------------------")); - myDMI.GetBaseBoard( csVendor, csModel, csVersion, csSN, csAssetTag); - str.Format( _T( "Vendor: %s"), csVendor); - m_List.AddString( str); - str.Format( _T( "Model: %s"), csModel); - m_List.AddString( str); - str.Format( _T( "Version: %s"), csVersion); - m_List.AddString( str); - str.Format( _T( "S/N: %s"), csSN); - m_List.AddString( str); - str.Format( _T( "Asset TAG: %s"), csAssetTag); - m_List.AddString( str); - - m_List.AddString( _T( "")); - m_List.AddString( _T( "------------------------------------------------------")); - m_List.AddString( _T( "System Enclosure info")); - m_List.AddString( _T( "------------------------------------------------------")); - myDMI.GetSystemEnclosure( csVendor, csType, csSN, csAssetTag); - str.Format( _T( "Vendor: %s"), csVendor); - m_List.AddString( str); - str.Format( _T( "Type: %s"), csType); - m_List.AddString( str); - str.Format( _T( "S/N: %s"), csSN); - m_List.AddString( str); - str.Format( _T( "Asset TAG: %s"), csAssetTag); - m_List.AddString( str); - m_List.AddString( _T( "")); - - m_List.AddString( _T( "")); - m_List.AddString( _T( "------------------------------------------------------")); - m_List.AddString( _T( "System UUID")); - m_List.AddString( _T( "------------------------------------------------------")); - myDMI.GetUUID( csSN); - str.Format( _T( "UUID: %s"), csSN); - m_List.AddString( str); - m_List.AddString( _T( "")); - - SysInfoLog( _T( "")); - SysInfoLog( _T( "------------------------------------------------------")); - SysInfoLog( _T( "System Slots info")); - SysInfoLog( _T( "------------------------------------------------------")); - myDMI.GetSystemSlots( &m_SlotList); - CSystemSlot mySlot; - pos = m_SlotList.GetHeadPosition(); - bContinue = (pos != NULL); - if (bContinue) - // There is one record => get the first - mySlot = m_SlotList.GetNext( pos); - while (bContinue) - { - bContinue = (pos != NULL); - str.Format( _T( "Name: %s"), mySlot.GetName()); - SysInfoLog( str); - str.Format( _T( "Description: %s"), mySlot.GetDescription()); - SysInfoLog( str); - str.Format( _T( "Slot Designation: %s"), mySlot.GetSlotDesignation()); - SysInfoLog( str); - str.Format( _T( "Usage: %s"), mySlot.GetUsage()); - SysInfoLog( str); - str.Format( _T( "Status: %s"), mySlot.GetStatus()); - SysInfoLog( str); - str.Format( _T( "Is shared: %s"), mySlot.IsShared() ? _T( "TRUE") : _T( "FALSE")); - SysInfoLog( str); - if (pos != NULL) - { - mySlot = m_SlotList.GetNext( pos); - SysInfoLog( _T( "")); - } - } - SysInfoLog( _T( "")); - str.Format( _T( "System Slots Hash: %s"), m_SlotList.GetHash()); - SysInfoLog( str); - - - SysInfoLog( _T( "")); - SysInfoLog( _T( "------------------------------------------------------")); - SysInfoLog( _T( "System Port info")); - SysInfoLog( _T( "------------------------------------------------------")); - myDMI.GetSystemPorts( &m_PortList); - CSystemPort myPort; - pos = m_PortList.GetHeadPosition(); - bContinue = (pos != NULL); - if (bContinue) - // There is one record => get the first - myPort = m_PortList.GetNext( pos); - while (bContinue) - { - bContinue = (pos != NULL); - str.Format( _T( "Type: %s"), myPort.GetType()); - SysInfoLog( str); - str.Format( _T( "Name: %s"), myPort.GetName()); - SysInfoLog( str); - str.Format( _T( "Caption: %s"), myPort.GetCaption()); - SysInfoLog( str); - str.Format( _T( "Description: %s"), myPort.GetDescription()); - SysInfoLog( str); - if (pos != NULL) - { - myPort = m_PortList.GetNext( pos); - SysInfoLog( _T( "")); - } - } - SysInfoLog( _T( "")); - str.Format( _T( "System Ports Hash: %s"), m_PortList.GetHash()); - SysInfoLog( str); - - SysInfoLog( _T( "")); - SysInfoLog( _T( "------------------------------------------------------")); - SysInfoLog( _T( "Memory Slots info")); - SysInfoLog( _T( "------------------------------------------------------")); - myDMI.GetMemorySlots( &m_MemoryList); - CMemorySlot myMemSlot; - pos = m_MemoryList.GetHeadPosition(); - bContinue = (pos != NULL); - if (bContinue) - // There is one record => get the first - myMemSlot = m_MemoryList.GetNext( pos); - while (bContinue) - { - bContinue = (pos != NULL); - str.Format( _T( "Caption: %s"), myMemSlot.GetCaption()); - SysInfoLog( str); - str.Format( _T( "Description: %s"), myMemSlot.GetDescription()); - SysInfoLog( str); - str.Format( _T( "Capacity: %s MB"), myMemSlot.GetCapacity()); - SysInfoLog( str); - str.Format( _T( "Usage: %s"), myMemSlot.GetUsage()); - SysInfoLog( str); - str.Format( _T( "Type: %s"), myMemSlot.GetType()); - SysInfoLog( str); - str.Format( _T( "Speed: %s MHz"), myMemSlot.GetSpeed()); - SysInfoLog( str); - str.Format( _T( "Slot Number: %u"), myMemSlot.GetSlotNumber()); - SysInfoLog( str); - str.Format( _T( "Serial Number: %s"), myMemSlot.GetSN()); - SysInfoLog( str); - if (pos != NULL) - { - myMemSlot = m_MemoryList.GetNext( pos); - SysInfoLog( _T( "")); - } - } - SysInfoLog( _T( "")); - str.Format( _T( "Memory Slots Hash: %s"), m_MemoryList.GetHash()); - SysInfoLog( str); -} /************************************************************************************/ /************************************************************************************/ diff --git a/TestSysInfo/TestSysInfoDlg.h b/TestSysInfo/TestSysInfoDlg.h index 8267c081..23a83719 100644 --- a/TestSysInfo/TestSysInfoDlg.h +++ b/TestSysInfo/TestSysInfoDlg.h @@ -82,7 +82,6 @@ class CTestSysInfoDlg : public CDialog DECLARE_MESSAGE_MAP() public: - afx_msg void OnBnClickedSmbios(); afx_msg void OnBnClickedWmi(); afx_msg void OnBnClickedSysinfo(); afx_msg void OnBnClickedLoadXml(); From fd9504030275a90769062ef4fc9089e0d11e3705 Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Thu, 28 Jan 2021 14:57:16 +0100 Subject: [PATCH 2/3] Add loop break --- SysInfo/IPHelper.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/SysInfo/IPHelper.cpp b/SysInfo/IPHelper.cpp index da4d3789..d3e94182 100644 --- a/SysInfo/IPHelper.cpp +++ b/SysInfo/IPHelper.cpp @@ -438,26 +438,26 @@ BOOL CIPHelper::GetNetworkAdapters(CNetworkAdapterList *pList) // Get subnet mask from the result of GetIpAddrTable for (ifIndex = 0; ifIndex < (UINT)pIPAddrTable->dwNumEntries; ifIndex++) - { + { if (pIfEntry->InterfaceIndex == pIPAddrTable->table[ifIndex].dwIndex) - { - // Get NetMask - IPAddr.S_un.S_addr = (u_long)pIPAddrTable->table[ifIndex].dwMask; - IPAddrBis.S_un.S_addr = (u_long)pIPAddrTable->table[ifIndex].dwAddr; - csSubnet = inet_ntop(AF_INET, &IPAddr, str, INET_ADDRSTRLEN); - csAddressIp = inet_ntop(AF_INET, &IPAddrBis, bufferstr, INET_ADDRSTRLEN); + { + // Get NetMask + IPAddr.S_un.S_addr = (u_long)pIPAddrTable->table[ifIndex].dwMask; + IPAddrBis.S_un.S_addr = (u_long)pIPAddrTable->table[ifIndex].dwAddr; + csSubnet = inet_ntop(AF_INET, &IPAddr, str, INET_ADDRSTRLEN); + csAddressIp = inet_ntop(AF_INET, &IPAddrBis, bufferstr, INET_ADDRSTRLEN); - inet_pton(AF_INET, bufferstr, &ipAdr); - inet_pton(AF_INET, str, &ipMsk); - nbRez = htonl(ipAdr & ipMsk); + inet_pton(AF_INET, bufferstr, &ipAdr); + inet_pton(AF_INET, str, &ipMsk); + nbRez = htonl(ipAdr & ipMsk); - ipa.S_un.S_addr = htonl(nbRez); - csSubnetNetwork = inet_ntop(AF_INET, &ipa, bufferRez, INET_ADDRSTRLEN); - cAdapter.SetNetNumber(csSubnetNetwork); + ipa.S_un.S_addr = htonl(nbRez); + csSubnetNetwork = inet_ntop(AF_INET, &ipa, bufferRez, INET_ADDRSTRLEN); + cAdapter.SetNetNumber(csSubnetNetwork); - // No loop break?? - } - } + break; + } + } // Outside the loop?? cAdapter.SetIPNetMask(csSubnet); @@ -480,7 +480,7 @@ BOOL CIPHelper::GetNetworkAdapters(CNetworkAdapterList *pList) getnameinfo(pGateway->Address.lpSockaddr, pGateway->Address.iSockaddrLength, buf4, sizeof(buf4), NULL, 0, NI_NUMERICHOST); cAdapter.SetGateway(CA2W(buf4)); - // No loop break?? + break; } } } From c88077e8baaf292748152059f81a018aa13d999b Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Thu, 28 Jan 2021 14:58:52 +0100 Subject: [PATCH 3/3] Update agent version --- Agent/OCSInventory.rc | 8 ++++---- ComHTTP/HTTP.rc | 8 ++++---- Download/Download.rc | 8 ++++---- NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x64.nsi | 2 +- NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x86.nsi | 2 +- OCSInventory Front/OCSInventory Front.rc | 8 ++++---- OcsNotifyUser/OcsNotifyUser.rc | 8 ++++---- OcsSystray/OcsSystray.rc | 8 ++++---- OcsWmi/OcsWmi.rc | 8 ++++---- Service/Service.rc | 8 ++++---- SysInfo/SysInfo.rc | 8 ++++---- SysInfo/SysInfo.vcxproj | 2 -- TestSysInfo/TestSysInfo.rc | 9 ++++----- 13 files changed, 42 insertions(+), 45 deletions(-) diff --git a/Agent/OCSInventory.rc b/Agent/OCSInventory.rc index 1048aa3e..4ac77eef 100644 --- a/Agent/OCSInventory.rc +++ b/Agent/OCSInventory.rc @@ -35,8 +35,8 @@ IDR_MAINFRAME ICON "res\\OCSInventory.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -54,13 +54,13 @@ BEGIN VALUE "Comments", "OCS Inventory Agent" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory Agent" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OCSInventory.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OCSInventory.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/ComHTTP/HTTP.rc b/ComHTTP/HTTP.rc index 4b8f0cf3..7ab6e592 100644 --- a/ComHTTP/HTTP.rc +++ b/ComHTTP/HTTP.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,13 +44,13 @@ BEGIN VALUE "Comments", "OCS Inventory Communication Provider" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory cURL Communication Provider" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "ComHTTP.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "ComHTTP.dll" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/Download/Download.rc b/Download/Download.rc index 90da85ba..ae23d079 100644 --- a/Download/Download.rc +++ b/Download/Download.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,13 +47,13 @@ BEGIN VALUE "Comments", "OCS Inventory Package Download and Setup Tool" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory Package Download and Setup Tool" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "Download.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "Download.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x64.nsi b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x64.nsi index d86a6b3b..574892b1 100644 --- a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x64.nsi +++ b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x64.nsi @@ -13,7 +13,7 @@ setcompressor /SOLID lzma ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "OCS Inventory NG Agent" !define OLD_PRODUCT_NAME "OCS Inventory Agent" -!define PRODUCT_VERSION "2.8.0.0" +!define PRODUCT_VERSION "2.8.0.1" !define PRODUCT_PUBLISHER "OCS Inventory NG Team" !define PRODUCT_WEB_SITE "http://www.ocsinventory-ng.org" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\OCSInventory.exe" diff --git a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x86.nsi b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x86.nsi index fc5a7809..a4deef16 100644 --- a/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x86.nsi +++ b/NSIS_agent_setup/OCS-NG_Windows_Agent_Setup_x86.nsi @@ -13,7 +13,7 @@ setcompressor /SOLID lzma ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "OCS Inventory NG Agent" !define OLD_PRODUCT_NAME "OCS Inventory Agent" -!define PRODUCT_VERSION "2.8.0.0" +!define PRODUCT_VERSION "2.8.0.1" !define PRODUCT_PUBLISHER "OCS Inventory NG Team" !define PRODUCT_WEB_SITE "http://www.ocsinventory-ng.org" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\OCSInventory.exe" diff --git a/OCSInventory Front/OCSInventory Front.rc b/OCSInventory Front/OCSInventory Front.rc index f36ffd59..2d9ba155 100644 --- a/OCSInventory Front/OCSInventory Front.rc +++ b/OCSInventory Front/OCSInventory Front.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,13 +44,13 @@ BEGIN VALUE "Comments", "OCS Inventory Framework Provider" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory Framework Provider" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OCSInventory Front.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OCSInventory Front.dll" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/OcsNotifyUser/OcsNotifyUser.rc b/OcsNotifyUser/OcsNotifyUser.rc index 51c43ec0..570b1486 100644 --- a/OcsNotifyUser/OcsNotifyUser.rc +++ b/OcsNotifyUser/OcsNotifyUser.rc @@ -386,8 +386,8 @@ IDR_MAINFRAME ICON "..\\Agent\\res\\OCSInventory.ic // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -405,13 +405,13 @@ BEGIN VALUE "Comments", "OCS Inventory User Notification Provider" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory User Notification Provider" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OcsNotifyUser.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsNotifyUser.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/OcsSystray/OcsSystray.rc b/OcsSystray/OcsSystray.rc index 726bed80..5e8f4776 100644 --- a/OcsSystray/OcsSystray.rc +++ b/OcsSystray/OcsSystray.rc @@ -388,8 +388,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -407,13 +407,13 @@ BEGIN VALUE "Comments", "OCS Inventory Systray applet" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory Systray applet" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OcsSystray.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsSystray.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/OcsWmi/OcsWmi.rc b/OcsWmi/OcsWmi.rc index b5694520..dfcf49c7 100644 --- a/OcsWmi/OcsWmi.rc +++ b/OcsWmi/OcsWmi.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,13 +44,13 @@ BEGIN VALUE "Comments", "OCS Inventory WMI Provider" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory WMI Provider" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OcsWmi.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsWmi.dll" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/Service/Service.rc b/Service/Service.rc index 3c4de4f4..b13013df 100644 --- a/Service/Service.rc +++ b/Service/Service.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,13 +44,13 @@ BEGIN VALUE "Comments", "OCS Inventory Service" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory Service" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "OcsService.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "OcsService.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/SysInfo/SysInfo.rc b/SysInfo/SysInfo.rc index 451c9001..817f0da4 100644 --- a/SysInfo/SysInfo.rc +++ b/SysInfo/SysInfo.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -44,13 +44,13 @@ BEGIN VALUE "Comments", "OCS Inventory System Provider" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory System Provider" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "SysInfo.dll" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "SysInfo.dll" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo" diff --git a/SysInfo/SysInfo.vcxproj b/SysInfo/SysInfo.vcxproj index 760cc8d1..13bf5a0b 100644 --- a/SysInfo/SysInfo.vcxproj +++ b/SysInfo/SysInfo.vcxproj @@ -178,7 +178,6 @@ - @@ -242,7 +241,6 @@ - diff --git a/TestSysInfo/TestSysInfo.rc b/TestSysInfo/TestSysInfo.rc index e81272a4..c12bd134 100644 --- a/TestSysInfo/TestSysInfo.rc +++ b/TestSysInfo/TestSysInfo.rc @@ -35,7 +35,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "Close",IDCANCEL,391,317,50,14 LISTBOX IDC_LIST1,7,41,434,255,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "SMBios/DMI",IDC_SMBIOS,7,317,50,14 PUSHBUTTON "WMI",IDC_WMI,77,317,50,14 PUSHBUTTON "SysInfo",IDC_SYSINFO,147,317,50,14 LTEXT "OCS Inventory System Functions Testing Tool",IDC_STATIC,44,13,397,11 @@ -51,8 +50,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,0,0 - PRODUCTVERSION 2,8,0,0 + FILEVERSION 2,8,0,1 + PRODUCTVERSION 2,8,0,1 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -70,13 +69,13 @@ BEGIN VALUE "Comments", "OCS Inventory System Information Testing tool" VALUE "CompanyName", "OCS Inventory" VALUE "FileDescription", "OCS Inventory System Information Testing tool" - VALUE "FileVersion", "2.8.0.0" + VALUE "FileVersion", "2.8.0.1" VALUE "InternalName", "TestSysInfo.exe" VALUE "LegalCopyright", "Open Source Software released under GNU General Public License V2" VALUE "LegalTrademarks", "http://www.ocsinventory-ng.org" VALUE "OriginalFilename", "TestSysInfo.exe" VALUE "ProductName", "OCS Inventory Windows Agent" - VALUE "ProductVersion", "2.8.0.0" + VALUE "ProductVersion", "2.8.0.1" END END BLOCK "VarFileInfo"