Re: pointer to a struct
From: -gtu99 (gtu99_at_discussions.microsoft.com)
Date: 07/22/04
- Next message: Philippe Bertrand: "Re: Include tag doesn't work in documentation comments"
- Previous message: Nicole Calinoiu: "Re: How to share assembly attributes between multiple assemblies?"
- In reply to: Mattias Sjögren: "Re: pointer to a struct"
- Next in thread: Mattias Sjögren: "Re: pointer to a struct"
- Reply: Mattias Sjögren: "Re: pointer to a struct"
- Reply: BMermuys: "Re: pointer to a struct"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 08:05:58 -0700
I am trying to work with Netbios and the NCB. In the NCB there is a buffer that is supposed to point to another struct, the ADAPTER_STATUS. However, the adapter_status struct contains an array which makes it managed. I just need to assign the buffer in the NCB struct to the address of the adapter_status struct. So, something like:
NCB myncb = new NCB();
ADAPTER_STATUS adapter = new ADAPTER_STATUS();
myncb.ncb_buffer = &adapter;
does not work, because I cannot use & with a managed struct. I know there must be a way to retrieve adapter's address in memory. I just don't know the syntax. I've looked at Marshal.PtrtoStructure and Marshal.StructuretoPtr, but I'm not sure if their what I'm looking for. Any help you can give would be great.
"Mattias Sjögren" wrote:
>
> >But my struct is a managed type, it contains an array. Shouldn't there still be a way to retrieve its address in memory?
>
> Perhaps if you told us what you're going to do with the pointer, we
> can help you find a solution or workaround.
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>
- Next message: Philippe Bertrand: "Re: Include tag doesn't work in documentation comments"
- Previous message: Nicole Calinoiu: "Re: How to share assembly attributes between multiple assemblies?"
- In reply to: Mattias Sjögren: "Re: pointer to a struct"
- Next in thread: Mattias Sjögren: "Re: pointer to a struct"
- Reply: Mattias Sjögren: "Re: pointer to a struct"
- Reply: BMermuys: "Re: pointer to a struct"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|