_fileinfo and _set_fileinfo in VS 2005

G

Guest

In older versions of Visual Studio, there was a global variable named
_fileinfo and/or a function named _set_fileinfo. These seem to be gone in
Visual Studio 2005. The documentation mentions them, but does not say what
should be used instead.

The purpose of these features was to control whether open files are
inherited by child processes created using _spawn.

Is there a similar way to control this under VS 2005? My goal is for the
files to be inherited. If this is the default, then I'm good, but I'd like to
know for sure.

Thank you.
 
B

Bruno van Dooren

In older versions of Visual Studio, there was a global variable named
_fileinfo and/or a function named _set_fileinfo. These seem to be gone in
Visual Studio 2005. The documentation mentions them, but does not say what
should be used instead.

The purpose of these features was to control whether open files are
inherited by child processes created using _spawn.

Is there a similar way to control this under VS 2005? My goal is for the
files to be inherited. If this is the default, then I'm good, but I'd like
to
know for sure.

The documentation
http://msdn2.microsoft.com/en-us/library/ecthkkx5.aspx
mentions that the global variable itself, and _get_fileinfo are no longer
supported.

You can still set the fileinfo variable through _set_fileinfo
apparently this was done for security reasons (see link)

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
G

Guest

The documentation http://msdn2.microsoft.com/en-us/library/ecthkkx5.aspx
mentions that the global variable itself, and _get_fileinfo are no longer
supported.

You can still set the fileinfo variable through _set_fileinfo
apparently this was done for security reasons (see link)

I agree that it says this. It's the same as the documentation included with
VS 2005 itself. However, _set_fileinfo doesn't really exist. It's not
mentioned in any header file, and I get an unresolved external when I try to
use it.

E:\tmp>cl fi.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.

fi.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

/out:fi.exe
fi.obj
fi.obj : error LNK2019: unresolved external symbol __set_fileinfo referenced
in function _main
fi.exe : fatal error LNK1120: 1 unresolved externals

The source for that is
--------------------
#include <stdlib.h>

void main(void)
{
_set_fileinfo(1);
}
 
B

Bruno van Dooren

You can still set the fileinfo variable through _set_fileinfo
I agree that it says this. It's the same as the documentation included
with
VS 2005 itself. However, _set_fileinfo doesn't really exist. It's not
mentioned in any header file, and I get an unresolved external when I try
to
use it.

I just did a search in my VC8 folder for any file that contains the string '
_set_fileinfo'
No hits.

also, the MSDN docs say on another page that _get_fileinfo is still
supported.
http://msdn2.microsoft.com/en-us/library/ecthkkx5.aspx
but the documentation for that function says that that is gone as well
http://msdn2.microsoft.com/en-us/library/tzwcfdtx.aspx

so I think the documentation for _set_fileinfo is wrong, and it is gone as
well.
is says that _get_fileinfo is no longer supported, but I think this is a
copy and paste error, and it should say '_set_fileinfo'.

If you want, you can use http://connect.microsoft.com/ for submitting
feedback so that the docs are updated.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top