Re: pointer to a struct

From: -gtu99 (gtu99_at_discussions.microsoft.com)
Date: 07/22/04


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.
>



Relevant Pages

  • Re: Fibre Channel Array Troubles.
    ... Subject: Fibre Channel Array Troubles. ... two hbas and I ran diagnostics today and it ... ent0 Available 1L-08 10/100 Mbps Ethernet PCI Adapter II ... ide0 Available 1G-19 ATA/IDE Controller Device ...
    (AIX-L)
  • Block sizes for Tru64 5.1Bv4
    ... We supplied an external 5TB array ... SCSI HBA is the KZPEA-DB U160 Dual Channel adapter. ... fine in the SRM (6 logicals on our external raid array) ... entities other than the intended recipient is prohibited. ...
    (comp.unix.tru64)
  • Problems with 2G HBA
    ... Adapter, and 3510FC Array. ... I installed all the necessary patches, ...
    (SunManagers)
  • Arena 8600 array on Ultra320 adapter
    ... or using a PCI Dual Channel Ultra2 SCSI Adapter ... PCI-X Dual Channel Ultra 320 SCSI adapter in an IBM ... I have tried a different but identical array, ...
    (comp.unix.aix)