473,320 Members | 1,810 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,320 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 2957

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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.