Re: When were scanf_s functions introduced?



Yes, that's about how static linking works. There are a few downsides
though:

- Increased memory usage (if you run two apps with the CRT static linked
instead of two apps with the CRT dynamic linked, then you might be
increasing physical commit as the CRT code inside the DLL could be
copy-on-write shared cross process while the static linked CRT code can't be
shared in memory between different .exes (although it could be for different
processes running from the same .exe on disk).
- Requires you to recompile your app if there is a security patch for the
CRT and you static linked to an affected function (instead of just deploying
another CRT DLL).
- When working with multiple binaries that link to the CRT, you may actually
end up saving space by linking to the DLL version if the CRT code is
duplicated enough times.

If you are just making a simple, small standalone app, then static linking
is probably a good idea. For nontrivial apps I would go with the DLL route
though.

"Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx> wrote in message
news:uMECVNIRGHA.4344@xxxxxxxxxxxxxxxxxxxxxxx
The DLL version required to support security-enhanced fucntions is
MSVCR80.dll which is 612 kb in size.

I relinked statically (/MT) which statically links in libcmt.lib (about
7.4 Mb).
However the resultant apps (which are not very big) amount to
about 100 kb ; e.g. this file hasher utility
http://www.jensign.com/hash/index.html

I don't have a good understanding of how static linking works with obj
.dll
libraries but I gather it just extracts the code from the static CRT
library that
is referenced in the application (hence my resultant code is still small )
?

Thanks,
- Mitch

"Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eVoz2bHRGHA.336@xxxxxxxxxxxxxxxxxxxxxxx
I would just redistribute the DLL version of the CRT. VC2005 comes with a
prepackaged installer and merge modules for it, I believe.

"Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx> wrote in message
news:OJnLX3GRGHA.196@xxxxxxxxxxxxxxxxxxxxxxx
Thanks. So I guess I need to recompile with /MT to static
link code into my application to ensure backward compatiblity.
- Mitch

"Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eEh$qqGRGHA.4572@xxxxxxxxxxxxxxxxxxxxxxx
Yes unless somebody else has already installed MSVCR80.dll.

"Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx> wrote in message
news:uS1GA6FRGHA.256@xxxxxxxxxxxxxxxxxxxxxxx
(a bit rusty on VC++ here ..)
I was looking at my compile options in VS 2005 and the /MD switch
is used for release by default. Does this mean that if I compile my
C code in VS 2005 with the default /MD compile switch, and specify
scanf_s() functions, the target platform will need updated dll
(MSVCR80.dll)
with those functions since the CRT is not statically linked into my
application?
http://msdn2.microsoft.com/en-us/library/abx4dbyh.aspx
Thanks,
- Mitch

"Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uVxeG5ERGHA.4344@xxxxxxxxxxxxxxxxxxxxxxx
They ship with the VS2005 CRT (and probably later CRTs). They were
not present in the VS2003 (or earlier) CRTs.

"Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx> wrote in message
news:uNz0KsERGHA.4960@xxxxxxxxxxxxxxxxxxxxxxx
When were the security-enhanced functions, like scanf_s, sscanf_s
etc. introduced?
I noticed that they are not included in the PSDK April 2005 MSDN
documentation,
but are included in VS 2005 docs.
- Mitch
















.



Relevant Pages

  • Re: When were scanf_s functions introduced?
    ... My knowledge of doing complicated MSI setup apps is fairly limited, ... installers, one that is a "full install" (includes everything and will be ... then the amount of space for the CRT ... the CRT dll MSVCR80.dll? ...
    (microsoft.public.platformsdk.security)
  • Re: When were scanf_s functions introduced?
    ... one that is a "web install" (checks dependencies and only downloads those that are missing, ... then the amount of space for the CRT installer is probably not going to matter much and ... the CRT dll MSVCR80.dll? ... Say I have several different apps to deploy. ...
    (microsoft.public.platformsdk.security)
  • Re: Problem with reading an int with operator>>
    ... implemented in header files, is compiled into MSVCP60.DLL. ... Because it makes it impossible to patch std::string without rebuilding MSVCP60.DLL (if you use static linking). ... At the time the decision was made to include string in the DLL, it obviously wasn't known that it either had any bugs in or that there would be a problem with patching the DLL in an SP, which is obviously the normal way that library bugs are handled. ... I believe this allows MS to fix the CRT DLLs using Windows Update ...
    (microsoft.public.vc.stl)
  • Re: When were scanf_s functions introduced?
    ... Why is the CRT static object library libcmt.dll about 10 times larger than ... the CRT dll MSVCR80.dll? ... Say I have several different apps to deploy. ... I gather that I need to read the MSDN docs on those system dlls and look at any OS ...
    (microsoft.public.platformsdk.security)
  • Re: DLLs and facets
    ... It sounds like the EXE and DLL are using the same CRT DLL, ... must be regarded as equivalent to static linking in terms of melding your ... whenever you update the compiler. ...
    (microsoft.public.vc.stl)