Re: VC .Net not mature?
From: Olaf Baeyens (olaf.baeyens_at_skyscan.be)
Date: 10/12/04
- Next message: Bonj: "Re: linker warning (further details)"
- Previous message: Bonj: "Re: linker warning (further details)"
- In reply to: The unProfessional: "Re: VC .Net not mature?"
- Next in thread: David McClarnon: "Re: VC .Net not mature?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 12 Oct 2004 11:20:04 +0200
> In big projects, using only h files could get nasty, because a
modification
> to a single h file would reguire a recompile of tons of files. With cpp
> files, compiles are generally much faster when only implementation (cpp)
is
> changed. Maybe I'll get used to it in time :)
>
This is why I use C# for none-time critical stuff, like the user interface.
And I use managed/unmanaged C++ for performance critical stuff.
> Olaf: what do you mean by "Security Integration"??
>
Default, a C# program (and probably managed C++) program have limited
security rights.
e.g.: Normally, it does not allow LAN rights, like opening files on a LAN,
or execute directly from a LAN network folder.
Create a C# program, copy it to a network drive and double click it will
generate a strange "access violation" like error that will scare anyone the
hell out of his life. This strangce error is just because the C# executable
does not have executable rights on that network drive. Copy it locally to
the C: drive and it works.
In order to make this work, 2 things must be in place.
* First you must provide in AssemblyInfo.cpp something like this:
The code below gives access just like a typical conventional executable,
which is unrestricted.
[assembly:SecurityPermission(SecurityAction::RequestMinimum,
UnmanagedCode=true)] // Request to run unmanaged code
[assembly:FileIOPermission(SecurityAction::RequestMinimum,
Unrestricted=true)] // Request complete File IO functionality
[assembly:RegistryPermission(SecurityAction::RequestMinimum, All="*")] //
Request complet access to the registery key
[assembly:ZoneIdentityPermission(SecurityAction::RequestMinimum,Zone=Securit
yZone::NoZone)] // Request unrestricted zone
It is up to you to restrict the rights, by removing unnessecary rights.
* Second the administrator must also give you rights, to run on a network
drive.
Normally this is done by goin to control panel/ Administrative Tools/
Microsoft .NET Framework 1.1 Configuration
But I do not prefer this approach since it is too complicated to let the
user do this configuration.
But there is also good news, this configuration can be automated, but you
must use the installer to configure it.
A C# program running on a network drive cannot register itself, but you can
provide a Installer class with the necesary configuration options and if you
provide the [RunInstaller(true)] attribute in that executable. Then the
installer program can load this class and execute the code with enough
rights.
I have to admit that I still do not understand every aspect but I keep on
learning.
I love this security thinng because it lets me create applications that are
more resistant to virusses and worms.
For example if I create a stupid clock, that does not need Internet, then if
a Worm can infect it, it will still be prevented to access the Internet to
infect others. Imagine that your complete OS contains code like this, then
Worms and Virusses would not have as much chance to spread itself.
- Next message: Bonj: "Re: linker warning (further details)"
- Previous message: Bonj: "Re: linker warning (further details)"
- In reply to: The unProfessional: "Re: VC .Net not mature?"
- Next in thread: David McClarnon: "Re: VC .Net not mature?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|