ImportAccessControl C# protected memory error

Hello,

I need to use AAAPI_IMPORTACCESSCONTROL in C#.

In the wrapper I did this...

[DllImport("dmawin.dll", CharSet = CharSet.Unicode)]
public static extern int aaApi_ImportAccessControl
    ( Guid iguid, string ifilename,  int iformat,  int ilevels,  int iflags);

In the function using the wrap, I use the folder GUID as a GUID, 2 for CSV, 0 for all Levels, and 0 for flags.

The GUID is correct and the CSV is a valid CSV file previously exported from folder Access Control in Project Wise Explorer.

Error: Attempted to read or write protected memory.

What is incorrect or missing?

Thanks for your patience.

 

Kevin.