By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

Guru-level question on pure managed C++

P: n/a
Good day ladies and gentlemen!

I have a short proggie:
-----------------------------------------------------------------------
#using <mscorlib.dll>
using namespace System::Security::Permissions;
[assembly:SecurityPermissionAttribute(
SecurityAction::RequestMinimum,SkipVerification=fa lse)];
using namespace System;
int main()
{
#if SSSS
Console::WriteLine(S"Hello,managed world!");
#else
int i(0);
#endif
return 0;
}
-----------------------------------------------------------------------
which, when compiled as follows:

cl /clr:initialAppDomain /Od /DSSSS=1 prog.cpp nochkclr.obj /link /entry:main /fixed:no /opt:ref
silo -s prog.exe
peverify prog.exe

produces a pure executable assembly. When SSSS=0 it creates an
working executable assembly that doesn't pass the purity test:

[IL]: Error: Unverifiable PE Header/native stub.

I've tried using "Int32" instead of "int" with no joy.

My question to the gurus is: what is the appropriate integer
type to use that will not destroy the purity of a .NET assembly?

I know that I should probably just wait for the 2004 release
of Visual Studio, but I like to hear the opinion of the gurus
about the current state of the art in purity of managed C++.

Thanks in advance,

Sylvester

Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I am far away from the Guru.
But I might know the answer

http://msdn.microsoft.com/msdnmag/is...03/VisualCNET/

Scroll till section "Verifiable Library Assemblies"
They suggest to have dummy variable to data section.

So when SSSS = 1 you have "Hello,managed world!" in data section. With SSSS
= 0 it's empty.
George.

"Kalafiorczyk" <ho*****@kalafiorczyk.com> wrote in message
news:eH****************@tk2msftngp13.phx.gbl...
Good day ladies and gentlemen!

I have a short proggie:
-----------------------------------------------------------------------
#using <mscorlib.dll>
using namespace System::Security::Permissions;
[assembly:SecurityPermissionAttribute(
SecurityAction::RequestMinimum,SkipVerification=fa lse)];
using namespace System;
int main()
{
#if SSSS
Console::WriteLine(S"Hello,managed world!");
#else
int i(0);
#endif
return 0;
}
-----------------------------------------------------------------------
which, when compiled as follows:

cl /clr:initialAppDomain /Od /DSSSS=1 prog.cpp nochkclr.obj /link /entry:main /fixed:no /opt:ref silo -s prog.exe
peverify prog.exe

produces a pure executable assembly. When SSSS=0 it creates an
working executable assembly that doesn't pass the purity test:

[IL]: Error: Unverifiable PE Header/native stub.

I've tried using "Int32" instead of "int" with no joy.

My question to the gurus is: what is the appropriate integer
type to use that will not destroy the purity of a .NET assembly?

I know that I should probably just wait for the 2004 release
of Visual Studio, but I like to hear the opinion of the gurus
about the current state of the art in purity of managed C++.

Thanks in advance,

Sylvester

Nov 16 '05 #2

P: n/a
Hello George!

"George Ter-Saakov" <no****@hotmail.com> wrote in:
So when SSSS = 1 you have "Hello,managed world!" in data section.
With SSSS = 0 it's empty.


Thanks, but this is not it. You can remove all conditional
compilation directives, have one String * and one int and the
peverify will still complain.

Regards,

Sylvester

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.