473,396 Members | 1,804 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,396 software developers and data experts.

asp.net + unmanaged dll security issues

Hi,
I'm developing an ASP.NET application. I imported a C++ dll into the C# code.
When I tried to access a function in that dll, application threw an exception
"System.Runtime.InteropServices.SEHException:Exter nal component has thrown
an exception". I debugged the unmanaged C++ code & found that the code that
generated this exception is

CDaoDatabase db;
db.open("C:\\VM.mdb") // this is the code that generated exception

I tried using try catch blocks
but the control does'nt come to catch block
How do i determine the exception?
The same dll function works fine if the dll is impoted in a Windows
application.
Is there any security issues in Web application?

Thanks in advance
Priya
Nov 18 '05 #1
2 1471
to get better error reporting, the c++ nneds to trap errors, and supply an
error reporting function. in your case the error is probably permission, as
asp.net does not have access rights to @"c:\" by default.
-- bruce (sqlwork.com)
"Priya" <Pr***@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
Hi,
I'm developing an ASP.NET application. I imported a C++ dll into the C# code. When I tried to access a function in that dll, application threw an exception "System.Runtime.InteropServices.SEHException:Exter nal component has thrown
an exception". I debugged the unmanaged C++ code & found that the code that generated this exception is

CDaoDatabase db;
db.open("C:\\VM.mdb") // this is the code that generated exception

I tried using try catch blocks
but the control does'nt come to catch block
How do i determine the exception?
The same dll function works fine if the dll is impoted in a Windows
application.
Is there any security issues in Web application?

Thanks in advance
Priya

Nov 18 '05 #2
I tried setting the write permission to the database file(I:\data\VM.mdb) ,
the folder containing the database file , to the aspx file and the folder
containing it in ASPNET account , Everyone , IUSR_Machinename account.

I added <identity impersonate ="true"> in web.config file.
The ASP.NET state service has default logon as Local System Account.

I modified username= "machine " to username = "system" in machine.config
(C:\Winnt\Microsoft.Net\Config\machine.config)
still it does'nt work.

What is the mistake i'd done???
Thanks
Priya

"bruce barker" wrote:
to get better error reporting, the c++ nneds to trap errors, and supply an
error reporting function. in your case the error is probably permission, as
asp.net does not have access rights to @"c:\" by default.
-- bruce (sqlwork.com)
"Priya" <Pr***@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
Hi,
I'm developing an ASP.NET application. I imported a C++ dll into the C#

code.
When I tried to access a function in that dll, application threw an

exception
"System.Runtime.InteropServices.SEHException:Exter nal component has thrown
an exception". I debugged the unmanaged C++ code & found that the code

that
generated this exception is

CDaoDatabase db;
db.open("C:\\VM.mdb") // this is the code that generated exception

I tried using try catch blocks
but the control does'nt come to catch block
How do i determine the exception?
The same dll function works fine if the dll is impoted in a Windows
application.
Is there any security issues in Web application?

Thanks in advance
Priya


Nov 18 '05 #3

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

Similar topics

1
by: Sai Kit Tong | last post by:
Hi, I am developing a new application running on Windows platform that needs to interface with existing legacy code - written in basic C / C++. I am trying to evaluate Java vs C#...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
7
by: Bob Rock | last post by:
Hello, converting from the managed to the unmanaged world (and viceversa strings) and byte arrays is something I do often and I'd like to identify the most correct and efficient way to do it....
3
by: JoeProgrammer | last post by:
A couple of questions re. managed vs. unmanaged code. 1. I know this depends on the app, but how much faster is unmanaged code vs. managed code? Is there an average figure for this? 2. Is it as...
13
by: bonk | last post by:
Hello, I am trying to create a dll that internally uses managed types but exposes a plain unmanaged interface. All the managed stuff shall be "wrapped out of sight". So that I would be able to...
2
by: Sandy | last post by:
I am confused about Unmanaged Code, How .Net Framework treate that code, What is the use of that. Thanks in advance Sandeep Chitode
12
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. ...
4
by: Stephen Walch | last post by:
Our application environment consists of three basic layers: 1. Third-party unmanaged DLLs that were written before the CLR was invented and maintain a significant amount of information (including...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.