1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.RPC
- {
-
-
-
- public struct SyntaxID
- {
- public const int Length = 20;
- public Guid InterfaceUUID;
- public uint InterfaceVersion;
- public SyntaxID(Guid interfaceUUID, uint interfaceVersion)
- {
- InterfaceUUID = interfaceUUID;
- InterfaceVersion = interfaceVersion;
- }
- public SyntaxID(byte[] buffer, int offset)
- {
- InterfaceUUID = LittleEndianConverter.ToGuid(buffer, offset + 0);
- InterfaceVersion = LittleEndianConverter.ToUInt32(buffer, offset + 16);
- }
- public void WriteBytes(byte[] buffer, int offset)
- {
- LittleEndianWriter.WriteGuidBytes(buffer, offset + 0, InterfaceUUID);
- LittleEndianWriter.WriteUInt32(buffer, offset + 16, InterfaceVersion);
- }
- public override bool Equals(object obj)
- {
- if (obj is SyntaxID)
- {
- return this.InterfaceUUID.Equals(((SyntaxID)obj).InterfaceUUID) && this.InterfaceVersion.Equals(((SyntaxID)obj).InterfaceVersion);
- }
- return false;
- }
- public override int GetHashCode()
- {
- return InterfaceUUID.GetHashCode() * InterfaceVersion.GetHashCode();
- }
- }
- }
|