Search code examples
c++winapivirtualboxcontrolflowguard

Unresolved external symbol __guard_fids_table


I'm compiling a huge open-source solution (Virtualbox 6.0.4 OSE Windows version actually), and got stuck with the following linking error (provided both command and error, formatted for readability)

C:/MSVS/10.0/VC/bin/link.exe’
-nologo’
-machine:x86
-Ignore:4197
-Driver
-Subsystem:NATIVE
-Incremental:NO
-Align:4096
-MapInfo:Exports
-NoD
-Release
-Debug
-Opt:Ref
-Opt:Icf
-Version:600.4
-Stub:winstub.com'
-IntegrityCheck
/Entry:DriverEntry@8
/OUT:VBoxWddm.sys
/MAPINFO:EXPORTS
/INCREMENTAL:NO
/MAP:VBoxWddm.map
/LIBPATH:C:/WinDDK/7600.16385.1/lib/wlh/i386
/LIBPATH:C:/WinDDK/8.1.1/Lib/win8/km/x86
@VBoxWddm.rsp
Creating library VBoxWddm.lib and object VBoxWddm.exp 
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_fids_table
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_fids_count
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_flags 
VBoxWddm.sys : fatal error LNK1120: 3 unresolved externals

Compiler is VC++ 10.0 (such an outdated compiler required by Oracle for COM interfaces backward compatibility), Windows 7 and 8.1 SDKs are installed.

As I found, __guard_fids_table is a part of Microsoft anti-malware Control Flow Guard API, introduced in Windows 8.1. Some sources tell it requires Visual C++ version 14.0 (which is MSVS 2015 Update 3), however, it's still lack of good documentation of this API, so I'm not 100% sure.

Problem is it could be both bug of the build system (Virtualbox OSE 6 is quite new, and not properly tested), or just some additional configuration required. I need some direction for further investigation, because there's literally no official documentation how to build Oracle Virtualbox 6, and their forum died many years ago.

The main question for that moment, is that even possible to link these objects with VC++ 10.0 or newer compiler required, or maybe just Windows 10 SDK.

Also just great is anyone has experience with compiling Virtualbox 6 already


Solution

  • If anyone would be interested, I found a solution. Windows DDK 8.0 is the last version supported by VC++ 10.0, and it should be used instead of 7.1 or 8.1. DDK 7.1 declared as not sufficient for building this particular driver, and 8.1 already contains Control Flow Guard API, so 8.0 is the only option left