Note that there are some explanatory texts on larger screens.

plurals
  1. POPInvoke - reading the value of a string field - "Attempted to read or write protected memory"
    primarykey
    data
    text
    <p>I'm having trouble accessing the some string fields in a COM interface. Calling the integer fields does not result in an error. When attempting call <code>clientID()</code>, <code>deviceID()</code> or <code>key()</code>, I get the old <em>"Attempted to read or write protected memory"</em> error.</p> <p><strong>Here is the source interface code:</strong> (code sourced from <a href="http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/public/nsICacheVisitor.idl" rel="nofollow noreferrer">here</a>)</p> <pre><code>[scriptable, uuid(fab51c92-95c3-4468-b317-7de4d7588254)] interface nsICacheEntryInfo : nsISupports { readonly attribute string clientID; readonly attribute string deviceID; readonly attribute ACString key; readonly attribute long fetchCount; readonly attribute PRUint32 lastFetched; readonly attribute PRUint32 lastModified; readonly attribute PRUint32 expirationTime; readonly attribute unsigned long dataSize; boolean isStreamBased(); }; </code></pre> <p><strong>Here is the C# code for accessing the interface:</strong></p> <pre><code>[Guid("fab51c92-95c3-4468-b317-7de4d7588254"), ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] interface nsICacheEntryInfo { string clientID(); string deviceID(); nsACString key(); int fetchCount(); Int64 lastFetched(); Int64 lastModified(); Int64 expirationTime(); uint dataSize(); [return: MarshalAs(UnmanagedType.Bool)] bool isStreamBased(); } </code></pre> <p>Any suggestions as to why simply trying to read a field should throw access violations at me?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload