Category : access-violation

I have a code that modifies a cached msi installer database which works fine when executed within a standalone exe. But when it is run from within an msi Custom Action I get an access violation that is very strange. const auto& msiProductCode = ::GetProductCode(::msiUpgradeCode); const auto& msiPath = ::GetCachedMSIPath(msiProductCode); PMSIHANDLE dbHandle{}; const auto res ..

Read more

i’m trying to call a function of a c++ library. On result there is a AccessViolationException but i haven’t any other details. How can i have more details of the error? Here there is my code Thanks This is the section where i declare the functions [DllImport("library.dll", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr getResult(); ..

Read more

I need some theoretical explanation of the following memory access violation BEFORE even entering the method: String testMethod (AnsiString param1); AnsiString A1 = testMethod(A1); I am trying to understand the theory behind the problem. A1 is getting initialized by the return value of testMethod() while at the same time it is passed to testMethod(). What ..

Read more

I have following code defined on the C# side that gets data from C++ library. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct Address { public string StreetName; public int StreetNumber; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct Person { public Address address; } [DllImport("MyLib", CharSet = CharSet.Unicode)] internal static extern int GetPersonInfo(ref Person p); In the ..

Read more