Unfortunately, your attachment didn't survive the trip. I assume that this struct is one that you're trying to get back from unmanaged code.
The problem I see is that you have a struct with one element that's an array, and another element that contains the length of that array. I don't see anything in the docs that's going to allow you to deal with that using the CLR marshaller. I think you're going to wind up writing a custom marshaller. Which shouldn't be that bad - just a little MC++, and then you apply it to this struct with the MarshalAs(UnmanagedType.CustomMarshaller, MarshalTypeRef=...) attribute. You should also read up on the StructLayout attribute, which is helpful when marshalling structs, although I don't think it will fix your problem. I haven't mucked around with this stuff in quite a while, though, so someone else might know of a trick you can use to get this to go. > I'm having a tough time trying to collection information > about Kerberos tickets that exist for the current logon > session. (See attached code example - AccessTktCache.cs.) In > particular, I'm having trouble trying to figure out how to > marshal the following struct: > > public struct KERB_QUERY_TKT_CACHE_RESPONSE > { > public KERB_PROTOCOL_MESSAGE_TYPE MessageType; > public ulong CountOfTickets; > public KERB_TICKET_CACHE_INFO[] Tickets; > } > > The marshaller bombs each and every time, stating that the > Tickets array couldn't be marshalled as a struct. > > Any suggestions? (Yes, I realize that MC++ would be a much > easier route for me to do what I'm trying to do.) You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.