C (char *), COM Interop BSTR. , , CoTask, , . [In], MarshalAs, . , IntPtrs, .
:
[Guid("fab51c92-95c3-4468-b317-7de4d7588254"), ComImport,
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface nsICacheEntryInfo
{
IntPtr clientID { get; }
IntPtr deviceID { get; }
IntPtr key { get; }
int fetchCount { get; }
uint lastFetched { get; }
uint lastModified { get; }
uint expirationTime { get; }
uint dataSize { get; }
[return: MarshalAs(UnmanagedType.Bool)]
bool isStreamBased();
}
, PRUint32s 32-, 64- , . , , idl, .
clientID deviceID Marshal.PtrToStrAnsi :
nsIMemory memoryManagerInstance = ;
nsICacheEntryInfo cacheEntryInstance = ;
IntPtr pClientID = cacheEntryInstance.clientID;
string clientID = Marshal.PtrToStringAnsi(pClientID);
NS_Free(pClientID);
memoryManagerInstance.free(pClientID);
NS_Free , , xpcom. , , . , ANSI, .
, - , , , , .