Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
DNS_RPC_RECORD (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct DNS_RPC_RECORD_HEADER
{
public UInt16 wDataLength;
public UInt16 wType;
public UInt32 dwFlags;
public UInt32 dwSerial;
public UInt32 dwTtlSeconds;
public UInt32 dwReserved; // REVERSED from MS documentation
public UInt32 dwTimeStamp; // REVERSED from MS documentation
public UInt32 dwTimeStamp;
public UInt32 dwReserved;
}
public struct DNS_RPC_RECORD
{
private DNS_RPC_RECORD_HEADER header;
public UInt16 wDataLength { get { return header.wDataLength;}}
public UInt16 wType { get { return header.wType;}}
public UInt32 dwFlags { get { return header.dwFlags;}}
public UInt32 dwSerial { get { return header.dwSerial;}}
public UInt32 dwTtlSeconds { get { return header.dwTtlSeconds;}}
public UInt32 dwTimeStamp { get { return header.dwTimeStamp;}}
public UInt32 dwReserved { get { return header.dwReserved; } }
//doesn't work, use load. [MarshalAs(UnmanagedType.ByValArray, ArraySubType=UnmanagedType.U1, SizeParamIndex=1)]
public byte[] Buffer;
public static DNS_RPC_RECORD Load(byte[] from)
{
GCHandle handle = GCHandle.Alloc(from, GCHandleType.Pinned);
DNS_RPC_RECORD_HEADER h = (DNS_RPC_RECORD_HEADER)Marshal.PtrToStructure(
handle.AddrOfPinnedObject(), typeof(DNS_RPC_RECORD_HEADER));
DNS_RPC_RECORD r = new DNS_RPC_RECORD();
r.header = h;
r.Buffer = new byte[r.wDataLength];
Marshal.Copy(new IntPtr(handle.AddrOfPinnedObject().ToInt64() + Marshal.SizeOf(h)), r.Buffer, 0, h.wDataLength);
handle.Free();
return r;
}
}
internal const ushort DNS_TYPE_A = 0x1;
internal const ushort DNS_TYPE_AAAA = 0x1c;
User-Defined Field Types:
None.
Notes:
To use this, get a byte array of the LDAP object (dnsNode)'s "dnsRecord" attribute, and call the static "Load" method.
Note there can be more than one value for the dnsRecord attribute in each LDAP object, it is an array. For example, there could be several IP addresses that correspond to this node.
The Load method is needed because there's no way (that I can find) to have Marshal automatically put the trailing bytes into the Buffer array. I have invented the "DNS_RPC_RECORD_HEADER" type so that I can use PtrToStructure to load all the constant-sized parts automatically.
There are more type constants that I'm not using; see the PDF.
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.