Build: Win7 vs Win2008

Hello,

I had vsprintf( ) in my driver code and there wasa warning for it. So I had
changed it to vsprintf_s( ). If I use Win7-x64 build environment,
everything compiles fine but when I use Win2008-X64 build, then I get the
following errors. I would like to use both the build environment and have
a generic method. Any suggestions?

error LNK2001: unresolved external symbol vsprintf_s
error LNK2001: unresolved external symbol wcscpy_s
error LNK2001: unresolved external symbol swprintf_s

Thanks in advance!
-Raj P.

Use the safe string methods of RtlString* or RtlUnicodeString* …

http://msdn.microsoft.com/en-us/library/windows/hardware/ff563885(v=vs.85).aspx

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth Pandurangan
Sent: Friday, March 08, 2013 5:16 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Build: Win7 vs Win2008

Hello,

I had vsprintf( ) in my driver code and there wasa warning for it. So I had changed it to vsprintf_s( ). If I use Win7-x64 build environment, everything compiles fine but when I use Win2008-X64 build, then I get the following errors. I would like to use both the build environment and have a generic method. Any suggestions?

error LNK2001: unresolved external symbol vsprintf_s
error LNK2001: unresolved external symbol wcscpy_s
error LNK2001: unresolved external symbol swprintf_s

Thanks in advance!
-Raj P.
— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers 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

Ntstrsafe.lib contains an implementation of vsnprintf_s, but the Rtl routines Kenny suggested are a better choice

d

Bent from my phone


From: Speer, Kennymailto:xxxxx
Sent: ?3/?8/?2013 5:19 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE: [ntdev] Build: Win7 vs Win2008

Use the safe string methods of RtlString* or RtlUnicodeString* ?

http://msdn.microsoft.com/en-us/library/windows/hardware/ff563885(v=vs.85).aspx

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth Pandurangan
Sent: Friday, March 08, 2013 5:16 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Build: Win7 vs Win2008

Hello,

I had vsprintf( ) in my driver code and there wasa warning for it. So I had changed it to vsprintf_s( ). If I use Win7-x64 build environment, everything compiles fine but when I use Win2008-X64 build, then I get the following errors. I would like to use both the build environment and have a generic method. Any suggestions?

error LNK2001: unresolved external symbol vsprintf_s
error LNK2001: unresolved external symbol wcscpy_s
error LNK2001: unresolved external symbol swprintf_s

Thanks in advance!
-Raj P.
— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers 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


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

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</mailto:xxxxx></mailto:xxxxx>

Thank you Kenny and Doran!!!

On Fri, Mar 8, 2013 at 5:34 PM, Doron Holan wrote:

> Ntstrsafe.lib contains an implementation of vsnprintf_s, but the Rtl
> routines Kenny suggested are a better choice
>
> d
>
> Bent from my phone
> ------------------------------
> From: Speer, Kenny
> Sent: 3/8/2013 5:19 PM
>
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Build: Win7 vs Win2008
>
> Use the safe string methods of RtlString* or RtlUnicodeString* ?
>
>
>
>
> http://msdn.microsoft.com/en-us/library/windows/hardware/ff563885(v=vs.85).aspx
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Rajinikanth Pandurangan
> Sent: Friday, March 08, 2013 5:16 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Build: Win7 vs Win2008
>
>
>
> Hello,
>
>
>
> I had vsprintf( ) in my driver code and there wasa warning for it. So I
> had changed it to vsprintf_s( ). If I use Win7-x64 build environment,
> everything compiles fine but when I use Win2008-X64 build, then I get the
> following errors. I would like to use both the build environment and have
> a generic method. Any suggestions?
>
>
>
> error LNK2001: unresolved external symbol vsprintf_s
>
> error LNK2001: unresolved external symbol wcscpy_s
>
> error LNK2001: unresolved external symbol swprintf_s
>
>
>
> Thanks in advance!
>
> -Raj P.
>
> — NTDEV is sponsored by OSR OSR is HIRING!! See
> http://www.osr.com/careers 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
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>

Use StringCchPrintf
“Rajinikanth Pandurangan” wrote in message news:xxxxx@ntdev…
Hello,

I had vsprintf( ) in my driver code and there wasa warning for it. So I had changed it to vsprintf_s( ). If I use Win7-x64 build environment, everything compiles fine but when I use Win2008-X64 build, then I get the following errors. I would like to use both the build environment and have a generic method. Any suggestions?

error LNK2001: unresolved external symbol vsprintf_s
error LNK2001: unresolved external symbol wcscpy_s
error LNK2001: unresolved external symbol swprintf_s

Thanks in advance!
-Raj P.