473,372 Members | 1,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Mixed mode app fails to run from UNC path on Windows 2000 Server only

emu
Hi All,

I have an unmanaged C++ application that references a mixed mode image
DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the
dll (the mixed mode dll) by running the following command line:

caspol.exe -polchgprompt off -machine -addgroup 1 -url "file://<UNC
path to dll>\mixedMode.dll" FullTrust ame "GroupName" -polchgprompt on
Then running the application from a UNC path would succeed.

We recompiled the DLL under VS2005 and .NET 2.0 and now just trusting
the DLL as above (running the .NET 2.0 version of CASPOL) is not
sufficient. When we run the application we receive a security error.
Only turning security off "caspol -s off" or trusting the entire path
using the command line below allows the application to run.

caspol.exe -m -ag 1 -url file://<UNC path to dll>/* FullTrust
However, when running the .NET 2.0 version of the application on a
Windows XP Pro machine, the first caspol command line is sufficient
(i.e. trusting the actual DLL).

So the situation is:
- Windows 2000 Server box runs .NET 1.1 version of app when DLL is
trusted
- Windows 2000 Server box does NOT run .NET 2.0 version of app when DLL
is trusted
- Windows 2000 Server box runs .NET 2.0 version of app when entire UNC
path is trusted
- Windows 2000 Server box runs .NET 2.0 version of app when CAS is
disabled (caspol -s off)
- Windows XP Pro box runs .NET 1.1 version of app when DLL is trusted
- Windows XP Pro box runs .NET 2.0 version of app when DLL is trusted

The error dialog looks something like:

Unhandled Exception! ExpCode: E0434F4D ExpFlags: 1 ExpAddress: 7C59BC3F
I believe, although I'm not certain, that E0434F4D simply indicates a
try block failed and an exception occurred.

I've included two stack traces, the first is when the DLL is granted
fulltrust using CASPOL and the second is when the DLL is not trusted
and neither is the path (and thus should fail to load). I didn't
included the entire stack but if it's helpful, I can provide it (it's
all stuff on the unmanaged and non-microsoft side).

DLL FullTrust
-------------------------
<EXCEPTION code="E0434F4D" addr="7C59BC3F" date="08/09/06"
time="00:18:25" code_desc="<unkown exception>" more_desc="">
<STACKENTRY decl="RaiseException" decl_offset="+86" srcfile=""
module="KERNEL32" base="7c570000" />
<STACKENTRY decl="DllCanUnloadNowInternal" decl_offset="+14249"
srcfile="" module="mscorwks" base="79e70000" />
<STACKENTRY decl="GetAddrOfContractShutoffFlag" decl_offset="+42967"
srcfile="" module="mscorwks" base="79e70000" />
<STACKENTRY decl="GetAddrOfContractShutoffFlag" decl_offset="+43136"
srcfile="" module="mscorwks" base="79e70000" />
<STACKENTRY decl="GetAddrOfContractShutoffFlag" decl_offset="+43147"
srcfile="" module="mscorwks" base="79e70000" />
</EXCEPTION>
DLL No Trust
------------------------
<EXCEPTION code="E0434F4D" addr="7C59BC3F" date="08/08/06"
time="23:53:12" code_desc="<unkown exception>" more_desc="">
<STACKENTRY decl="RaiseException" decl_offset="+86" srcfile=""
module="KERNEL32" base="7c570000" />
<STACKENTRY decl="DllCanUnloadNowInternal" decl_offset="+14249"
srcfile="" module="mscorwks" base="79e70000" />
<STACKENTRY decl="DllCanUnloadNowInternal" decl_offset="+14868"
srcfile="" module="mscorwks" base="79e70000" />
<STACKENTRY decl="CorDllMainForThunk" decl_offset="+195" srcfile=""
module="mscorwks" base="79e70000" />
<STACKENTRY decl="CorDllMainWorker" decl_offset="+188" srcfile=""
module="mscoree" base="79000000" />
<STACKENTRY decl="GetTargetForVTableEntry" decl_offset="+34" srcfile=""
module="mscoree" base="79000000" />
...... Some of the stack omitted for brevity.
Very different stack traces, so obviously code is following a different
path when the DLL is granted fulltrust. Perhaps something else has to
be done on a Windows 2000 Server machine to enable CAS to allow the DLL
to be loaded???

The fusion log shows pretty much the same thing whether I trust just
the DLL and the app fails to run or I turn off security and the app
runs correctly. The fusion log says it binds to the the mixed mode DLL
successfully etc. even when security settings cause the app to fail.
The only difference I've noticed is that in the successful case it
shows that System.Xml.dll is being loaded (our mixed mode DLL
references System.Xml.dll) where as in the failure case it never loads
System.Xml.dll.

Any ideas on how to find out more about what is happening during the
loading of the assemblies and .NET security checks?

Does anyone know why CAS on a Windows 2000 Server box would behave
differently to a Windows XP box when using .NET 2.0 apps? The mixed
mode DLL is not signed.

Thanks,
D.

Aug 11 '06 #1
0 2964

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam Stewart | last post by:
Hi All, We have started to get the strangest errors with our SQL Server. We use Windows and SQL Server authentication, and have done successfully for the last year or so. However last week i had...
1
by: Peter Scheurer | last post by:
I have a statement that works in compatibility mode 8 of SQL Server 2000 while it fails in 7: declare @P3 int exec sp_prepexec @P3 output, N'@P1 float', N'select custname from customer where...
4
by: Kulgan | last post by:
Hi All I am trying to switch from Windows to Mixed mode authentication on SQL Server 2000. I am right-clicking the server instance in Enterprise Manager and selecting the correct option from the...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
5
by: Adam McKee | last post by:
We are using Visual Studio.NET 2003 in our project with .NET framework 1.1. One of our libraries is a mixed-mode dll assembly consisting of one managed C++ library, and several unmanaged C++...
2
by: Yang Pang | last post by:
I have a project where the GUI is in VB.NET, the libraries in unmanaged C++ which is wrapped in managed C++ and compiled as DLL. The application runs fine on Windows 2000 with VC++ development...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
6
by: Frank | last post by:
Straightforward VB.NET 2002 code that works form both Windows and ASP.NET apps on a Windows 2000 machine, and works in the Windows app on a newly installed XP machine, but fails in the ASP.NET...
4
by: tripwater | last post by:
Hello, I am currently trying to learn VS, using C#. I have a book called Beginning C# Databases. I am using sqlserver and the first half of the book deals with windows apps. So it uses the windows...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.