H
hiralparikh
Hi,
I am using .NET 2.0 and trying to use a function from a native DLL
file.
Here is the syntax that I am using:
definition:
[DllImport(@"old.dll", EntryPoint="#1")]
public static extern String getPwd(String strServerName, String
strUserId);
Call:
string pwd = getPwd("servername", "myusername");
I get the following error on the above line:
________________
Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read
or write protected memory. This is often an indication that other
memory is corrupt.
___________________
I have read the MSDN articles on these issues but those solutions are
not working.
Foll is the output of the 'link' command about the dll:
link -dump -exports old.dll
File Type: DLL
Section contains the following exports for old.dll
00000000 characteristics
3A352AEB time date stamp Mon Dec 11 14:28:43 2000
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 000012F0 _pwGet@12
Summary
5000 .data
2000 .rdata
1000 .reloc
A000 .text
Any help , direction is greatly appreciated.
Thanks,
Hiral
I am using .NET 2.0 and trying to use a function from a native DLL
file.
Here is the syntax that I am using:
definition:
[DllImport(@"old.dll", EntryPoint="#1")]
public static extern String getPwd(String strServerName, String
strUserId);
Call:
string pwd = getPwd("servername", "myusername");
I get the following error on the above line:
________________
Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.AccessViolationException: Attempted to read
or write protected memory. This is often an indication that other
memory is corrupt.
___________________
I have read the MSDN articles on these issues but those solutions are
not working.
Foll is the output of the 'link' command about the dll:
link -dump -exports old.dll
File Type: DLL
Section contains the following exports for old.dll
00000000 characteristics
3A352AEB time date stamp Mon Dec 11 14:28:43 2000
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 000012F0 _pwGet@12
Summary
5000 .data
2000 .rdata
1000 .reloc
A000 .text
Any help , direction is greatly appreciated.
Thanks,
Hiral