Type
{$IFDEF WIN64}
xDWORD = DWORD64;
{$ELSE}
xDWORD = DWORD;
{$ENDIF}
PMSV1_0_INTERACTIVE_LOGON= ^MSV1_0_INTERACTIVE_LOGON;
MSV1_0_INTERACTIVE_LOGON = Record
MessageType :MSV1_0_LOGON_SUBMIT_TYPE;
LogonDomainName :UNICODE_STRING;
UserName :UNICODE_STRING;
Password :UNICODE_STRING;
End;
// 计算的时候需要考虑X86/X64的区别{内存地址长度的问题}
Function AdjustPointer(Buffer, Base:Pointer):xDWORD;
begin
if (xDWORD(Buffer) < xDWORD(Base)) then
begin
Result := xDWORD(Buffer);
end else
begin
Result := (xDWORD(Buffer) - xDWORD(Base));
end;
end;
// 计算字符串的偏移地址
ProtocolSubmitBuffer^.LogonDomainName.Buffer := PWideChar(xDWORD(ProtocolSubmitBuffer) + AdjustPointer(ProtocolSubmitBuffer^.LogonDomainName.Buffer, ClientBufferBase));