G
Guest
Hello
I have problem with IJolietDiscMaster interface.
I`m using CSharp and .Net 1.1
I`m trying to set properties with SetJolietProperties(ref IPropertyStorage
pPropStg) method but it crushes with null refference exception.
I found a lot of libraries which has same problem and I cant find solution
for this.
I use folowing code
//import of IJolietDiscMaster and IPropertyStorage
[ComImport]
[Guid("E3BC42CE-4E5C-11D3-9144-00104BA11C5E")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IJolietDiscMaster
{
void GetTotalDataBlocks(out int pnBlocks);
void GetUsedDataBlocks(out int pnBlocks);
void GetDataBlockSize(out int pnBlockBytes);
void AddData(IStorage pStorage, int lFileOverwrite);
void GetJolietProperties(out IPropertyStorage ppPropStg);
void SetJolietProperties(ref IPropertyStorage pPropStg);
}
[ComImport]
[Guid("00000138-0000-0000-c000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IPropertyStorage
{
unsafe void ReadMultiple(uint p1, ref PROPSPEC p2, ref PROPVARIANT p3);
unsafe void WriteMultiple(uint p1, ref PROPSPEC p2, ref PROPVARIANT p3, uint
p4);
[PreserveSig]
unsafe int DeleteMultiple(uint p1, PROPSPEC* p2);
[PreserveSig]
unsafe int ReadPropertyNames(uint p1, uint* p2, char** p3);
[PreserveSig]
unsafe int WritePropertyNames(uint p1, uint* p2, char** p3);
[PreserveSig]
unsafe int DeletePropertyNames(uint p1, uint* p2);
[PreserveSig]
int Commit(uint p1);
[PreserveSig]
int Revert();
[PreserveSig]
unsafe int Enum(void** p1);
[PreserveSig]
unsafe int SetTimes(FILETIME* p1, FILETIME* p2, FILETIME* p3);
[PreserveSig]
unsafe int SetClass(Guid* p1);
[PreserveSig]
unsafe int Stat(STATPROPSETSTG* p1);
}
and code
IPropertyStorage ppPropStg;
fDataDiscWriter.GetJolietProperties(out ppPropStg);
fDataDiscWriter.SetJolietProperties(ref ppPropStg);
ppPropStg pointer returned by GetJulietProperties is not null and it is
valid. It is readable and writable no problems.
Any help will be appreciated.
I have problem with IJolietDiscMaster interface.
I`m using CSharp and .Net 1.1
I`m trying to set properties with SetJolietProperties(ref IPropertyStorage
pPropStg) method but it crushes with null refference exception.
I found a lot of libraries which has same problem and I cant find solution
for this.
I use folowing code
//import of IJolietDiscMaster and IPropertyStorage
[ComImport]
[Guid("E3BC42CE-4E5C-11D3-9144-00104BA11C5E")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IJolietDiscMaster
{
void GetTotalDataBlocks(out int pnBlocks);
void GetUsedDataBlocks(out int pnBlocks);
void GetDataBlockSize(out int pnBlockBytes);
void AddData(IStorage pStorage, int lFileOverwrite);
void GetJolietProperties(out IPropertyStorage ppPropStg);
void SetJolietProperties(ref IPropertyStorage pPropStg);
}
[ComImport]
[Guid("00000138-0000-0000-c000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IPropertyStorage
{
unsafe void ReadMultiple(uint p1, ref PROPSPEC p2, ref PROPVARIANT p3);
unsafe void WriteMultiple(uint p1, ref PROPSPEC p2, ref PROPVARIANT p3, uint
p4);
[PreserveSig]
unsafe int DeleteMultiple(uint p1, PROPSPEC* p2);
[PreserveSig]
unsafe int ReadPropertyNames(uint p1, uint* p2, char** p3);
[PreserveSig]
unsafe int WritePropertyNames(uint p1, uint* p2, char** p3);
[PreserveSig]
unsafe int DeletePropertyNames(uint p1, uint* p2);
[PreserveSig]
int Commit(uint p1);
[PreserveSig]
int Revert();
[PreserveSig]
unsafe int Enum(void** p1);
[PreserveSig]
unsafe int SetTimes(FILETIME* p1, FILETIME* p2, FILETIME* p3);
[PreserveSig]
unsafe int SetClass(Guid* p1);
[PreserveSig]
unsafe int Stat(STATPROPSETSTG* p1);
}
and code
IPropertyStorage ppPropStg;
fDataDiscWriter.GetJolietProperties(out ppPropStg);
fDataDiscWriter.SetJolietProperties(ref ppPropStg);
ppPropStg pointer returned by GetJulietProperties is not null and it is
valid. It is readable and writable no problems.
Any help will be appreciated.