A
andrew lowe
Hi,
This was originally posted in framework.interop but am trying here now.
I'm trying to define the IISIPSecurity interface described at
http://msdn.microsoft.com/library/d...ry/en-us/iissdk/iis/ref_prog_iaorefiipsec.asp.
I'm getting a NullReferenceException when i try to set the GrantByDefault
property, eg:
IISIPSecurity ipSecurity =
(IISIPSecurity)entry.Properties["IPSecurity"].Value;
bool grantByDefault;
ipSecurity.GrantByDefault(out grantByDefault);
grantByDefault = false;
// Exception thrown here
ipSecurity.GrantByDefault(grantByDefault);
I've defined the interface as:
[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
GuidAttribute("F3287521-BBA3-11D0-9BDC-00A0C922E703")]
public interface IISIPSecurity
{
[PreserveSig, DispId(4)]
int IPDeny([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(4)]
int IPDeny([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(5)]
int IPGrant([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(5)]
int IPGrant([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(6)]
int DomainDeny([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(6)]
int DomainDeny([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(7)]
int DomainGrant([Out, MarshalAs(UnmanagedType.SafeArray)] out object
retVal);
[PreserveSig, DispId(7)]
int DomainGrant([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(8)]
int GrantByDefault([Out, MarshalAs(UnmanagedType.VariantBool)] out bool
retVal);
[PreserveSig, DispId(8)]
int GrantByDefault([In, MarshalAs(UnmanagedType.VariantBool)] bool rhs);
}
Do I have faults with the interface definition ?
tia
andrew
This was originally posted in framework.interop but am trying here now.
I'm trying to define the IISIPSecurity interface described at
http://msdn.microsoft.com/library/d...ry/en-us/iissdk/iis/ref_prog_iaorefiipsec.asp.
I'm getting a NullReferenceException when i try to set the GrantByDefault
property, eg:
IISIPSecurity ipSecurity =
(IISIPSecurity)entry.Properties["IPSecurity"].Value;
bool grantByDefault;
ipSecurity.GrantByDefault(out grantByDefault);
grantByDefault = false;
// Exception thrown here
ipSecurity.GrantByDefault(grantByDefault);
I've defined the interface as:
[ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
GuidAttribute("F3287521-BBA3-11D0-9BDC-00A0C922E703")]
public interface IISIPSecurity
{
[PreserveSig, DispId(4)]
int IPDeny([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(4)]
int IPDeny([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(5)]
int IPGrant([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(5)]
int IPGrant([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(6)]
int DomainDeny([Out, MarshalAs(UnmanagedType.SafeArray)] out object retVal);
[PreserveSig, DispId(6)]
int DomainDeny([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(7)]
int DomainGrant([Out, MarshalAs(UnmanagedType.SafeArray)] out object
retVal);
[PreserveSig, DispId(7)]
int DomainGrant([In, MarshalAs(UnmanagedType.SafeArray)] object rhs);
[PreserveSig, DispId(8)]
int GrantByDefault([Out, MarshalAs(UnmanagedType.VariantBool)] out bool
retVal);
[PreserveSig, DispId(8)]
int GrantByDefault([In, MarshalAs(UnmanagedType.VariantBool)] bool rhs);
}
Do I have faults with the interface definition ?
tia
andrew