Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Writing WDF Drivers for Windows Lab, Palo Alto, CA 28 April-2 May, 2014
Advanced WDF Driver Lab, Palo Alto, CA 5-8 May, 2014
Developing File Systems for Windows, Boston/Waltham, MA 13-16 May, 2014
Windows Internals & Software Drivers Lab, Dulles/Sterling, VA, CA 23-27 June, 2014


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 9  
16 Sep 11 16:17
VF
xxxxxx@goodrich.com
Join Date: 20 Mar 2007
Posts To This List: 18
Unresolved external symbol @__security_check_cookie@4

I have a Visual Studio 2005 driver project that builds ok in VS 2005 (both Checked and Free). I converted the project to VS 2010 and I am getting the following linker error message. Any advice? error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "long __stdcall AddDevice(struct _DRIVER_OBJECT *,struct _DEVICE_OBJECT *)" (?AddDevice@@YGJPAU_DRIVER_OBJECT@@PAU_DEVICE_OBJECT@@@Z)
  Message 2 of 9  
16 Sep 11 16:25
Don Burn
xxxxxx@acm.org
Join Date:
Posts To This List: 3179
Re: Unresolved external symbol @__security_check_cookie@4

Looks like you are trying to build a driver with the build tool and environment. This is a really stupid idea, but if you insist on producing bad code look at the /GS switch. Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr "xxxxx@goodrich.com" <xxxxx@goodrich.com> wrote in message news:166823@ntdev: > I have a Visual Studio 2005 driver project that builds ok in VS 2005 (both Checked and Free). I converted the project to VS 2010 and I am getting the following linker error message. Any advice? > > error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "long __stdcall AddDevice(struct _DRIVER_OBJECT *,struct _DEVICE_OBJECT *)" (?AddDevice@@YGJPAU_DRIVER_OBJECT@@PAU_DEVICE_OBJECT@@@Z)
  Message 3 of 9  
16 Sep 11 16:33
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 8858
RE: Re:Unresolved external symbol @__security_check_cookie@4

The __security_check_cookie reference was added by /gs. Link against bufferoverflowk.lib. as don said, though, you are off in undocumented and uncharted and unsupported waters by using VS to build your driver with any kit pre win8 d -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn Sent: Friday, September 16, 2011 1:25 PM To: Windows System Software Devs Interest List Subject: Re:[ntdev] Unresolved external symbol @__security_check_cookie@4 Looks like you are trying to build a driver with the build tool and environment. This is a really stupid idea, but if you insist on producing bad code look at the /GS switch. Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr "xxxxx@goodrich.com" <xxxxx@goodrich.com> wrote in message news:166823@ntdev: > I have a Visual Studio 2005 driver project that builds ok in VS 2005 (both Checked and Free). I converted the project to VS 2010 and I am getting the following linker error message. Any advice? > > error LNK2019: unresolved external symbol @__security_check_cookie@4 > referenced in function "long __stdcall AddDevice(struct _DRIVER_OBJECT > *,struct _DEVICE_OBJECT *)" > (?AddDevice@@YGJPAU_DRIVER_OBJECT@@PAU_DEVICE_OBJECT@@@Z) --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  Message 4 of 9  
16 Sep 11 17:11
Bruce Cran
xxxxxx@cran.org.uk
Join Date:
Posts To This List: 244
Re: Unresolved external symbol @__security_check_cookie@4

On 16/09/2011 21:33, Doron Holan wrote: > The __security_check_cookie reference was added by /gs. Link against bufferoverflowk.lib. as don said, though, you are off in undocumented and uncharted and unsupported waters by using VS to build your driver with any kit pre win8 It looks like the 7.1 WDK also supports /GS via the BUFFER_OVERFLOW_CHECKS option in sources. I think you could avoid the reference if you set BUFFER_OVERFLOW_CHECKS=0. -- Bruce Cran
  Message 5 of 9  
16 Sep 11 17:15
VF
xxxxxx@goodrich.com
Join Date: 20 Mar 2007
Posts To This List: 18
RE: Unresolved external symbol @__security_check_cookie@4

Creating driver projects in VS came from appendix B of Walter Oney's book "Programming the Microsoft Windows Driver Model". I included bufferoverflowk.lib in the linker and got past that problem. However, there is another problem. So, I will just use VS 2005 and continue on my merry way.
  Message 6 of 9  
16 Sep 11 17:18
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 8858
RE: Unresolved external symbol @__security_check_cookie@4

Don't set BUFFER_OVERFLOW_CHECKs to zero, it will make your driver less secure. A KMDF driver requires /GS btw d -----Original Message----- From: Bruce Cran [mailto:xxxxx@cran.org.uk] Sent: Friday, September 16, 2011 2:10 PM To: Windows System Software Devs Interest List Cc: Doron Holan Subject: Re: [ntdev] Unresolved external symbol @__security_check_cookie@4 On 16/09/2011 21:33, Doron Holan wrote: > The __security_check_cookie reference was added by /gs. Link against > bufferoverflowk.lib. as don said, though, you are off in undocumented > and uncharted and unsupported waters by using VS to build your driver > with any kit pre win8 It looks like the 7.1 WDK also supports /GS via the BUFFER_OVERFLOW_CHECKS option in sources. I think you could avoid the reference if you set BUFFER_OVERFLOW_CHECKS=0. -- Bruce Cran
  Message 7 of 9  
17 Sep 11 14:38
Calvin Guan
xxxxxx@gradovec.com
Join Date: 11 Oct 2009
Posts To This List: 434
Re: Unresolved external symbol @__security_check_cookie@4

In DDK 3790.1830 x86 build env, /GS- doesn't work... x86 CL doesn't recognize the minus sign. I stumbled on this thing while I was using it to build some code for my EFI boot ROM. The only way to get rid of the cookie is to enable some sort of optimization if you don't want to nake the functions. --
  Message 8 of 9  
18 Sep 11 21:10
Maxim S. Shatskih
xxxxxx@storagecraft.com
Join Date: 20 Feb 2003
Posts To This List: 9273
Re: Re:Unresolved external symbol @__security_check_cookie@4

>win8 And even in Win8 you need a special kind of VS's project, correct? -- Maxim S. Shatskih Windows DDK MVP xxxxx@storagecraft.com http://www.storagecraft.com
  Message 9 of 9  
18 Sep 11 21:12
Maxim S. Shatskih
xxxxxx@storagecraft.com
Join Date: 20 Feb 2003
Posts To This List: 9273
Re: Unresolved external symbol @__security_check_cookie@4

>will just use VS 2005 and continue on my merry way. ...from issue to issue :-) Install the proper WDK and then DDKBUILD.BAT to run WDK as Custom Build Step from VS. -- Maxim S. Shatskih Windows DDK MVP xxxxx@storagecraft.com http://www.storagecraft.com
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 17:37.


Copyright ©2014, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license