Skip to content

Conversation

lchico
Copy link
Member

@lchico lchico commented Nov 29, 2024

Related issue
wazuh/wazuh#25766

Description

This PR introduces the integration of the Wazuh agent with both the WMI and WMA APIs to retrieve a comprehensive list of installed Windows updates. The retrieved update data will seamlessly merge into the existing Syscollector inventory to provide a more complete view of system updates.

To avoid the following issue, I have to split the CMake test into two different executables, as you will see in the CMakeLists.txt.

Redefinitions error
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\ws2def.h(240,16): error C2011: 'sockaddr': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(482,8):
      see declaration of 'sockaddr'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\ws2def.h(442,5): error C2143: syntax error: missing '}' before 'constant' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\ws2def.h(442,5): error C2059: syntax error: 'constant' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\ws2def.h(496,1): error C2143: syntax error: missing ';' before '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\ws2def.h(638,16): error C2011: 'sockaddr_in': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(309,8):
      see declaration of 'sockaddr_in'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(136,16): error C2011: 'fd_set': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(65,16):
      see declaration of 'fd_set'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(180,8): error C2011: 'timeval': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(108,8):
      see declaration of 'timeval'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(236,9): error C2011: 'hostent': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(164,9):
      see declaration of 'hostent'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(249,9): error C2011: 'netent': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(177,9):
      see declaration of 'netent'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(256,9): error C2011: 'servent': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(184,9):
      see declaration of 'servent'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(268,9): error C2011: 'protoent': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(196,9):
      see declaration of 'protoent'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(364,16): error C2011: 'WSAData': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(319,16):
      see declaration of 'WSAData'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(462,8): error C2011: 'sockproto': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(491,8):
      see declaration of 'sockproto'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(504,9): error C2011: 'linger': 'struct' type redefinition [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(528,9):
      see declaration of 'linger'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1628,1): error C2375: 'accept': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(739,19):
      see declaration of 'accept'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1650,1): error C2375: 'bind': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(744,16):
      see declaration of 'bind'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1671,1): error C2375: 'closesocket': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(749,16):
      see declaration of 'closesocket'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1688,1): error C2375: 'connect': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(751,16):
      see declaration of 'connect'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1709,1): error C2375: 'ioctlsocket': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(756,16):
      see declaration of 'ioctlsocket'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1732,1): error C2375: 'getpeername': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(761,16):
      see declaration of 'getpeername'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1753,1): error C2375: 'getsockname': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(766,16):
      see declaration of 'getsockname'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1774,1): error C2375: 'getsockopt': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(771,16):
      see declaration of 'getsockopt'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1799,1): error C2375: 'htonl': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(778,19):
      see declaration of 'htonl'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1816,1): error C2375: 'htons': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(780,20):
      see declaration of 'htons'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1834,1): error C2375: 'inet_addr': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(782,26):
      see declaration of 'inet_addr'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1852,1): error C2375: 'inet_ntoa': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(784,23):
      see declaration of 'inet_ntoa'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1952,1): error C2375: 'listen': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(786,16):
      see declaration of 'listen'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1971,1): error C2375: 'ntohl': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(790,19):
      see declaration of 'ntohl'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(1988,1): error C2375: 'ntohs': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(792,20):
      see declaration of 'ntohs'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2005,1): error C2375: 'recv': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(794,16):
      see declaration of 'recv'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2028,1): error C2375: 'recvfrom': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(800,16):
      see declaration of 'recvfrom'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2055,1): error C2375: 'select': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(808,16):
      see declaration of 'select'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2080,1): error C2375: 'send': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(815,16):
      see declaration of 'send'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2103,1): error C2375: 'sendto': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(821,16):
      see declaration of 'sendto'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2130,1): error C2375: 'setsockopt': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(829,16):
      see declaration of 'setsockopt'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2155,1): error C2375: 'shutdown': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(836,16):
      see declaration of 'shutdown'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2175,1): error C2375: 'socket': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(840,19):
      see declaration of 'socket'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2200,1): error C2375: 'gethostbyaddr': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(847,33):
      see declaration of 'gethostbyaddr'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2222,1): error C2375: 'gethostbyname': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(852,33):
      see declaration of 'gethostbyname'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2239,1): error C2375: 'gethostname': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(854,16):
      see declaration of 'gethostname'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2279,1): error C2375: 'getservbyport': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(858,33):
      see declaration of 'getservbyport'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2298,1): error C2375: 'getservbyname': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(862,33):
      see declaration of 'getservbyname'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2317,1): error C2375: 'getprotobynumber': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(866,34):
      see declaration of 'getprotobynumber'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2334,1): error C2375: 'getprotobyname': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(868,34):
      see declaration of 'getprotobyname'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2354,1): error C2375: 'WSAStartup': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(872,16):
      see declaration of 'WSAStartup'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2374,1): error C2375: 'WSACleanup': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(876,16):
      see declaration of 'WSACleanup'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2391,1): error C2375: 'WSASetLastError': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(878,17):
      see declaration of 'WSASetLastError'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2408,1): error C2375: 'WSAGetLastError': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(880,16):
      see declaration of 'WSAGetLastError'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2429,1): error C2375: 'WSAIsBlocking': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(882,17):
      see declaration of 'WSAIsBlocking'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2447,1): error C2375: 'WSAUnhookBlockingHook': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(884,16):
      see declaration of 'WSAUnhookBlockingHook'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2465,1): error C2375: 'WSASetBlockingHook': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(886,20):
      see declaration of 'WSASetBlockingHook'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2483,1): error C2375: 'WSACancelBlockingCall': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(888,16):
      see declaration of 'WSACancelBlockingCall'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2501,1): error C2375: 'WSAAsyncGetServByName': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(890,19):
      see declaration of 'WSAAsyncGetServByName'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2529,1): error C2375: 'WSAAsyncGetServByPort': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(898,19):
      see declaration of 'WSAAsyncGetServByPort'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2557,1): error C2375: 'WSAAsyncGetProtoByName': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(906,19):
      see declaration of 'WSAAsyncGetProtoByName'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2583,1): error C2375: 'WSAAsyncGetProtoByNumber': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(913,19):
      see declaration of 'WSAAsyncGetProtoByNumber'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2609,1): error C2375: 'WSAAsyncGetHostByName': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(920,19):
      see declaration of 'WSAAsyncGetHostByName'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2635,1): error C2375: 'WSAAsyncGetHostByAddr': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(927,19):
      see declaration of 'WSAAsyncGetHostByAddr'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2665,1): error C2375: 'WSACancelAsyncRequest': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(936,16):
      see declaration of 'WSACancelAsyncRequest'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(2683,1): error C2375: 'WSAAsyncSelect': redefinition; different linkage [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock.h(938,16):
      see declaration of 'WSAAsyncSelect'
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(4315,1): error C2059: syntax error: '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winsock2.h(4315,1): error C2143: syntax error: missing ';' before '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\registryHelper\include\registryHelper.hpp(14,1): error C2143: syntax error: missing ';' before '{' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\registryHelper\include\registryHelper.hpp(14,1): error C2447: '{': missing function header (old-style formal list?) [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(44,20): error C2039: 'Registry': is not a member of 'Utils' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      D:\a\wazuh-agent\wazuh-agent\src\common\stringHelper\include\stringHelper.hpp(8,11):
      see declaration of 'Utils'
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(44,20): error C2065: 'Registry': undeclared identifier [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(44,29): error C2146: syntax error: missing ';' before identifier 'root' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(44,29): error C2065: 'root': undeclared identifier [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(59,45): error C3878: syntax error: unexpected token 'packageReg' following 'expression' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(59,60): error C2760: syntax error: ',' was unexpected here; expected ';' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(59,60): error C3878: syntax error: unexpected token ',' following 'expression-statement' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(59,113): error C2760: syntax error: '}' was unexpected here; expected ';' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(72,17): error C2059: syntax error: '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(72,17): error C2143: syntax error: missing ';' before '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(42,9): error C2317: 'try' block starting on line '42' has no catch handlers [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(73,13): error C3927: '->': trailing return type is not allowed after a non-function declarator [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
  logcollector.cpp
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(73,17): error C3484: syntax error: expected '->' before the return type [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(73,18): error C3613: missing return type after '->' ('int' assumed) [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(73,13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(73,18): error C2146: syntax error: missing ';' before identifier 'enumerate' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(75,9): error C2059: syntax error: 'catch' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(76,9): error C2143: syntax error: missing ';' before '{' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(76,9): error C2447: '{': missing function header (old-style formal list?) [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(78,5): error C2059: syntax error: '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(78,5): error C2143: syntax error: missing ';' before '}' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(85,5): error C2143: syntax error: missing ';' before '{' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(85,5): error C2447: '{': missing function header (old-style formal list?) [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(125,37): error C3878: syntax error: unexpected token 'packageReg' following 'expression' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(126,28): error C2760: syntax error: ',' was unexpected here; expected ';' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(126,28): error C3878: syntax error: unexpected token ',' following 'expression-statement' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(126,109): error C2760: syntax error: '}' was unexpected here; expected ';' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(126,110): error C2059: syntax error: ';' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(127,21): error C2065: 'packageReg': undeclared identifier [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(127,42): error C2065: 'callbackKey': undeclared identifier [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(111,9): error C2317: 'try' block starting on line '111' has no catch handlers [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(129,20): error C2039: 'Registry': is not a member of 'Utils' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
      D:\a\wazuh-agent\wazuh-agent\src\common\stringHelper\include\stringHelper.hpp(8,11):
      see declaration of 'Utils'
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(129,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(129,29): error C2146: syntax error: missing ';' before identifier 'root' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(129,34): error C2143: syntax error: missing ';' before '{' [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(129,34): error C2447: '{': missing function header (old-style formal list?) [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(130,13): error C3927: '->': trailing return type is not allowed after a non-function declarator [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
D:\a\wazuh-agent\wazuh-agent\src\common\data_provider\src\packages\packagesWindowsParserHelper.h(130,13): error C[1003](https://github.com/wazuh/wazuh-agent/actions/runs/14265712779/job/39986951167#step:6:1006): error count exceeds 100; stopping compilation [D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoWin\sysInfoWindows_unit_test.vcxproj]
  (compiling source file '../../../../../src/common/data_provider/tests/sysInfoWin/sysInfoWin_test.cpp')
  
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/common/data_provider/tests/sysInfoPackages/CMakeLists.txt
  Generating Code...
  main.cpp
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/common/data_provider/tests/sysInfoNetworkWindows/CMakeLists.txt
  main.cpp
  Generating Code...
  sysInfoPackagesNPM_test.cpp
  sysInfoNetworkWindows_test.cpp
  sysinfo_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfo\RelWithDebInfo\sysinfo_unit_test.exe
  logcollector_win.cpp
  Generating Code...
  sysInfoPackagesPYPI_test.cpp
  sysInfoNetworkWindows_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoNetworkWindows\RelWithDebInfo\sysInfoNetworkWindows_unit_test.exe
  event_reader_win.cpp
  Generating Code...
  Generating Code...
  Logcollector.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\logcollector\RelWithDebInfo\Logcollector.lib
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/CMakeLists.txt
  sysInfoPackages_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\common\data_provider\tests\sysInfoPackages\RelWithDebInfo\sysInfoPackages_unit_test.exe
  inventory.cpp
  inventoryImp.cpp
  inventoryNormalizer.cpp
  statelessEvent.cpp
  Generating Code...
  Inventory.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\RelWithDebInfo\Inventory.lib
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/CMakeLists.txt
  moduleManager.cpp
  ModuleManager.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\RelWithDebInfo\ModuleManager.lib
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/logcollector/tests/unit/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/tests/inventoryImp/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/tests/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/tests/invNormalizer/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/tests/statelessEvent/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/testtool/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/modules/inventory/tests/inventory/CMakeLists.txt
  inventoryImp_test.cpp
  inventory_test.cpp
  logcollector_test.cpp
  agent_runner_win.cpp
  main.cpp
  statelessEvent_test.cpp
  windows_api_facade.cpp
  windows_service.cpp
  moduleManager_test.cpp
  file_reader_win_test.cpp
  signal_handler_win.cpp
  instance_handler_win.cpp
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/tests/inventory/RelWithDebInfo/inventory_unit_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/tests/inventory/RelWithDebInfo/inventory_unit_test.exp
  statelessEvent_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\tests\statelessEvent\RelWithDebInfo\statelessEvent_unit_test.exe
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/tests/inventoryImp/RelWithDebInfo/inventoryimp_unit_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/tests/inventoryImp/RelWithDebInfo/inventoryimp_unit_test.exp
  inventory_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\tests\inventory\RelWithDebInfo\inventory_unit_test.exe
  inventoryimp_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\tests\inventoryImp\RelWithDebInfo\inventoryimp_unit_test.exe
  agent.cpp
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/testtool/RelWithDebInfo/inventory_test_tool.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/inventory/testtool/RelWithDebInfo/inventory_test_tool.exp
  inventory_test_tool.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\testtool\RelWithDebInfo\inventory_test_tool.exe
  event_reader_win_test.cpp
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/tests/RelWithDebInfo/module_manager_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/modules/tests/RelWithDebInfo/module_manager_test.exp
  invNormalizer_test.cpp
  module_manager_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\tests\RelWithDebInfo\module_manager_test.exe
  agent_enrollment.cpp
  Generating Code...
  agent_runner.cpp
  inv_normalizer_unit_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\inventory\tests\invNormalizer\RelWithDebInfo\inv_normalizer_unit_test.exe
  logcollector_unit_tests.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\modules\logcollector\tests\unit\RelWithDebInfo\logcollector_unit_tests.exe
  command_handler_utils.cpp
  message_queue_utils.cpp
  signal_handler.cpp
  instance_handler.cpp
  Generating Code...
  Agent.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\RelWithDebInfo\Agent.lib
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/tests/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/tests/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/tests/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/tests/CMakeLists.txt
  Building Custom Rule D:/a/wazuh-agent/wazuh-agent/src/agent/tests/CMakeLists.txt
  signal_handler_test.cpp
  main.cpp
  message_queue_utils_test.cpp
  agent_enrollment_test.cpp
  windows_service_test.cpp
  agent_test.cpp
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/RelWithDebInfo/wazuh-agent.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/RelWithDebInfo/wazuh-agent.exp
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/windows_service_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/windows_service_test.exp
  signal_handler_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\tests\RelWithDebInfo\signal_handler_test.exe
  wazuh-agent.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\RelWithDebInfo\wazuh-agent.exe
  windows_service_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\tests\RelWithDebInfo\windows_service_test.exe
  	Embedding manifest in D:/a/wazuh-agent/wazuh-agent/build-windows-2022/wazuh-agent
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/agent_enrollment_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/agent_enrollment_test.exp
  agent_enrollment_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\tests\RelWithDebInfo\agent_enrollment_test.exe
  Embedding manifest in the executable...
     Creating library D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/agent_test.lib and object D:/a/wazuh-agent/wazuh-agent/build-windows-2022/agent/tests/RelWithDebInfo/agent_test.exp
  message_queue_utils_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\tests\RelWithDebInfo\message_queue_utils_test.exe
  agent_test.vcxproj -> D:\a\wazuh-agent\wazuh-agent\build-windows-2022\agent\tests\RelWithDebInfo\agent_test.exe
Error: Process completed with exit code 1.

Click here for more details

Tests

Package

 ./mock-server --https --log-stateful > aux.txt

Copy the Wazuh agent configuration to enable connection to the mock-server.

wazuh-agent-windows.yml
agent:
  thread_count: 4
  server_url: https://192.168.100.250:27000
  retry_interval: 30s
  verification_mode: none
  queue_size: 10000
events:
  batch_interval: 10s
  batch_size: 1MB
inventory:
  enabled: true
  interval: 1h
  scan_on_start: true
  hardware: false
  system: false
  networks: false
  packages: false
  ports: false
  ports_all: false
  processes: false
  hotfixes: true
logcollector:
  enabled: true
  reload_interval: 1m
  read_interval: 500ms
  windows:
    - channel: System
    - channel: Application
    - channel: Security

Note: Remove any unnecessary fields from the inventory.

Enroll wazuh-agent:

wazuh-agent.exe --config-file wazuh-agent-windows.yml --e
nroll --enroll-url https://192.168.100.250:55000 --user wazuh --password topsecret --name dummy
Starting wazuh-agent enrollment
wazuh-agent enrolled

Connect wazuh-agent with the server:

wazuh-agent.exe --config-file wazuh-agent-windows.yml

To get hotfixes from the mock server, I capture the output to an aux.txt file, and after a while, I filter the hotfixes:

grep 'hotfix"' aux.txt | jq '.package.hotfix.name' |sort |uniq
Hotfixes windows 10
main Actual PR
"KB2468871" "KB2478063" "KB2533523" "KB2544514" "KB2600211" "KB2600217" "KB5011048" "KB5014032" "KB5015684" "KB5016705" "KB5017022" "KB5026037" "KB5034122" "KB5034441" "KB5034466" "KB5034468" "KB5049621" "KB5053606" "KB2267602" "KB2468871" "KB2478063" "KB2533523" "KB2544514" "KB2600211" "KB2600217" "KB4052623" "KB5011048" "KB5014032" "KB5015684" "KB5016705" "KB5017022" "KB5026037" "KB5032907" "KB5034122" "KB5034441" "KB5034466" "KB5034468" "KB5054682" "KB5054978" "KB5055518" "KB5055683" "KB890830"

@lchico lchico linked an issue Nov 29, 2024 that may be closed by this pull request
3 tasks
@lchico lchico changed the title Port WMI, WMA APIs Integration for Retrieving Installed Windows Updates Port commit from wazuh/wazuh - WMI, WMA APIs Integration for Retrieving Installed Windows Updates Nov 29, 2024
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch 6 times, most recently from 4491817 to 8b9fa14 Compare January 30, 2025 20:02
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch 11 times, most recently from 4b2735f to 6ab5e4c Compare April 5, 2025 03:28
@lchico lchico closed this Apr 5, 2025
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch from 6ab5e4c to 60b751d Compare April 5, 2025 03:29
@lchico lchico reopened this Apr 5, 2025
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch 8 times, most recently from d513138 to 69f43b4 Compare April 9, 2025 09:48
@lchico lchico marked this pull request as ready for review April 10, 2025 20:48
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch 3 times, most recently from eed6c4d to 93c61ae Compare April 12, 2025 16:28
Merge pull request #26706 from wazuh/enhancement/25766-develop-integration-with-wmi-api-to-retrieve-installed-windows-updates

Develop Integration with WMI and WUA APIs to Retrieve Installed Windows Updates

feat: enhancement code
@lchico lchico force-pushed the enhancement/25766-integration-wmi-wua-apis-windows-updates branch from 93c61ae to 829d85d Compare April 15, 2025 12:05
Copy link
Member

@MarcelKemp MarcelKemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MarcelKemp MarcelKemp merged commit 8b6ac3d into main Apr 15, 2025
7 checks passed
@MarcelKemp MarcelKemp deleted the enhancement/25766-integration-wmi-wua-apis-windows-updates branch April 15, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Develop Integration with WMI API to Retrieve Installed Windows Updates

2 participants