>>716
殆どの場面で大丈夫な方法。
 使い方は if ByteComp(s,d,sizeof(s)) then ・・・

function ByteComp(const s,d;const count:Integer):boolean;
type
TAbyte = array [0..1] of byte;
TpAbyte = ^TAbyte;
var ps:TpAByte ;
var pd:TpAByte ;
var i:Integer;
begin
  ps:=TpAByte(@s);
  pd:=TpAByte(@d);

  Result:= integer(ps)=integer(pd);
  for i:=0 to count-1 do begin
   Result:= ps^[i] = pd^[i];
   if not Result then exit;
  end;
end;

ただし、普通の Tpoint,TRectは大丈夫だけど byteとかsmallintを含む場合
アラインされたゴミ領域に誰かが書き込みすれば希望の動作が出来なくなる