Microsoft
Software
Hardware
Network
Question : Security Exception in P/Invoke from C# to Win32 DLL
Background:
I created a DLL using C++ and am calling the functions using Managed C# code with P/Invoke. I am receiving the below error after calling a Win32 API Function from within the DLL:
Unhandled Exception: System.AccessViolationExce
ption: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at GetFileSecurityW(Char* , UInt32 , Void* , UInt32 , UInt32* )
at Query(_bstr_t* bstrPath)
at Test.Program.Query(String strPath)
at Test.Program.Main(String[]
args) in Program.cs:line 23
Is this an issue with .NET security levels?
Answer : Security Exception in P/Invoke from C# to Win32 DLL
Try the following link may help you
http://stackoverflow.co
m/question
s/732304/a
ccessviola
tionexcept
ion-during
-p-invoke-
help
Random Solutions
Raising an event
GPO for Printer Preferences not applying to Windows 7 clients
Which version of Novell Client should I use when attaching Windows 2003 to a Netware 4.11 server?
With an Intel I7-920 CPU -- am I wasting money buying DDR3 1600 RAM
Form seems like it is hang during Directory.Getfiles on a large directory structure.
Interpreting Wiring Diagram
DNS resolution across domains
Mac OS 10.4.10 into Intel Core2Duo Desktop PC
Outlook/OWA error after connecting mailbox to user account
Password protect a form - the Sequel