Hi Support,
I found the conflict between declarations in netfw.h
and networkisolation.h
. The bug was detected in following Windows SDK's:
- v10.0.17134.0
- v10.0.18362.0
- v10.0.19041.0
The netfw.h
declare WinAPI calls without WINAPI
calling convention. This typo is cause of compiler or linker errors.
netfw.h
:
DWORD
NetworkIsolationEnumAppContainers(
_In_ DWORD Flags,
_Out_ DWORD *pdwNumPublicAppCs,
_Outptr_result_buffer_(*pdwNumPublicAppCs) PINET_FIREWALL_APP_CONTAINER *ppPublicAppCs
);
networkisolation.h
:
DWORD
WINAPI
NetworkIsolationEnumAppContainers(
DWORD Flags,
_Out_ DWORD* pdwNumPublicAppCs,
_Outptr_result_buffer_(*pdwNumPublicAppCs) PINET_FIREWALL_APP_CONTAINER* ppPublicAppCs
);
Compiler errors:
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(102,1): error C2373: 'NetworkIsolationSetupAppContainerBinaries': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(395): message : see declaration of 'NetworkIsolationSetupAppContainerBinaries'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(115,1): error C2373: 'NetworkIsolationRegisterForAppContainerChanges': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(480): message : see declaration of 'NetworkIsolationRegisterForAppContainerChanges'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(125,1): error C2373: 'NetworkIsolationUnregisterForAppContainerChanges': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(487): message : see declaration of 'NetworkIsolationUnregisterForAppContainerChanges'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(140,1): error C2373: 'NetworkIsolationFreeAppContainers': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(496): message : see declaration of 'NetworkIsolationFreeAppContainers'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(147,1): error C2373: 'NetworkIsolationEnumAppContainers': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(501): message : see declaration of 'NetworkIsolationEnumAppContainers'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(156,1): error C2373: 'NetworkIsolationGetAppContainerConfig': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(507): message : see declaration of 'NetworkIsolationGetAppContainerConfig'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(164,1): error C2373: 'NetworkIsolationSetAppContainerConfig': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(512): message : see declaration of 'NetworkIsolationSetAppContainerConfig'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\networkisolation.h(190,1): error C2373: 'NetworkIsolationDiagnoseConnectFailureAndGetInfo': redefinition; different type modifiers
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\netfw.h(528): message : see declaration of 'NetworkIsolationDiagnoseConnectFailureAndGetInfo'
Linker errors:
1>XXX.obj : error LNK2019: unresolved external symbol _NetworkIsolationFreeAppContainers referenced in function _main
1>XXX.obj : error LNK2019: unresolved external symbol _NetworkIsolationEnumAppContainers referenced in function _main
1>XXX.obj : error LNK2019: unresolved external symbol _NetworkIsolationGetAppContainerConfig referenced in function _main
1>XXX.obj : error LNK2019: unresolved external symbol _NetworkIsolationDiagnoseConnectFailureAndGetInfo referenced in function "void __cdecl CheckNetworkIsolationDiagnoseConnectFailure(wchar_t const *)" (?CheckNetworkIsolationDiagnoseConnectFailure@@YAXPB_W@Z)
1>C:\Users\XXX\source\repos\XXX\Debug\XXX.exe : fatal error LNK1120: 4 unresolved externals
Could you please fix ASAP?
Sincerely yours,
ww898