From: Jan M on
Hi,

Working with WDK example MSVAD. Added wcscat_s() and get "unresolved
external symbol _wcscat_s referenced in function "long __stdcall
MyFunction()".

wcscat() links (with #pragma warning (disable: 4995)) but OACR constantly
nags "... is banned ...".

What lib do I need to link in to resolve this (MS docs dont seem to have
this info for WDK).

Thanks.

Jan


From: Don Burn on
Well the bottom line is you should not be using wcscat in the kernel period.
Personally, I find that there is little reason to use NULL terminated
strings in the kernel using UNICODE_STRING instead with
RtlAppendUnicodeStringToString for the equivalent of wcscat. If you
really need to use NULL terminated strings, then look at RtlStringCbCat,
RtlStringCbCatEx, RtlStringCbCatN, RtlStringCbCatNEx one of these will serve
the purpose.

In general when reviewing kernem mode code, if I see a C language library
function it is a red flag that the developer at a minimum does not know the
kernel environment and probably has a bug in his code.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"Jan M" <jan_m(a)jerseymail.co.uk> wrote in message
news:ucD59dOnKHA.2544(a)TK2MSFTNGP04.phx.gbl...
> Hi,
>
> Working with WDK example MSVAD. Added wcscat_s() and get "unresolved
> external symbol _wcscat_s referenced in function "long __stdcall
> MyFunction()".
>
> wcscat() links (with #pragma warning (disable: 4995)) but OACR constantly
> nags "... is banned ...".
>
> What lib do I need to link in to resolve this (MS docs dont seem to have
> this info for WDK).
>
> Thanks.
>
> Jan
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4801 (20100124) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4801 (20100124) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




From: Maxim S. Shatskih on
> Working with WDK example MSVAD. Added wcscat_s()

Try StringCchCat or StringCbCat instead.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: Jan M on
Thanks guys.

I settled for StringCchCatNW().

Jan