亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sconnectex.pas

?? 一般的數據庫管理系統 uses Classes, SConnectEx, TltConst, ExtCtrls, MMSystem, Types, windows, TltLogic , Sy
?? PAS
?? 第 1 頁 / 共 5 頁
字號:

{*******************************************************}
{                                                       }
{       Borland Delphi Visual Component Library         }
{       Streamed Connection classes                     }
{                                                       }
{       Copyright (c) 1997,99 Inprise Corporation       }
{                                                       }
{*******************************************************}

unit SConnectEx;

{$R-}

interface

uses
  Variants, Windows, Messages, Classes, SysUtils, ScktComp, WinSock,
  WinInet, ComObj;

type

  {$HPPEMIT '#pragma link "wininet.lib"'}

  { IDataBlock }
  TLoginEvent = procedure(Sender: TObject; Username, Password: string) of object;

  IDataBlock = interface(IUnknown)
  ['{CA6564C2-4683-11D1-88D4-00A0248E5091}']
    function GetBytesReserved: Integer; stdcall;
    function GetMemory: Pointer; stdcall;
    function GetSize: Integer; stdcall;
    procedure SetSize(Value: Integer); stdcall;
    function GetStream: TStream; stdcall;
    function GetSignature: Integer; stdcall;
    procedure SetSignature(Value: Integer); stdcall;
    procedure Clear; stdcall;
    function Write(const Buffer; Count: Integer): Integer; stdcall;
    function Read(var Buffer; Count: Integer): Integer; stdcall;
    procedure IgnoreStream; stdcall;
    function InitData(Data: Pointer; DataLen: Integer; CheckLen: Boolean): Integer; stdcall;
    property BytesReserved: Integer read GetBytesReserved;
    property Memory: Pointer read GetMemory;
    property Signature: Integer read GetSignature write SetSignature;
    property Size: Integer read GetSize write SetSize;
    property Stream: TStream read GetStream;
  end;

  { ISendDataBlock }

  ISendDataBlock = interface
  ['{87AD1043-470E-11D1-88D5-00A0248E5091}']
    function Send(const Data: IDataBlock; WaitForResult: Boolean): IDataBlock; stdcall;
  end;

  { ITransport }

  ITransport = interface(IUnknown)
  ['{CA6564C1-4683-11D1-88D4-00A0248E5091}']
    function GetWaitEvent: THandle; stdcall;
    function GetConnected: Boolean; stdcall;
    procedure SetConnected(Value: Boolean); stdcall;
    function Receive(WaitForInput: Boolean; Context: Integer): IDataBlock; stdcall;
    function Send(const Data: IDataBlock): Integer; stdcall;
    property Connected: Boolean read GetConnected write SetConnected;
  end;

  { IDataIntercept }

  IDataIntercept = interface
  ['{B249776B-E429-11D1-AAA4-00C04FA35CFA}']
    procedure DataIn(const Data: IDataBlock); stdcall;
    procedure DataOut(const Data: IDataBlock); stdcall;
  end;

  { TDataBlock }

  TDataBlock = class(TInterfacedObject, IDataBlock)
  private
    FStream: TMemoryStream;
    FReadPos: Integer;
    FWritePos: Integer;
    FIgnoreStream: Boolean;
  protected
    { IDataBlock }
    function GetBytesReserved: Integer; stdcall;
    function GetMemory: Pointer; stdcall;
    function GetSize: Integer; stdcall;
    procedure SetSize(Value: Integer); stdcall;
    function GetStream: TStream; stdcall;
    function GetSignature: Integer; stdcall;
    procedure SetSignature(Value: Integer); stdcall;
    procedure Clear; stdcall;
    function Write(const Buffer; Count: Integer): Integer; stdcall;
    function Read(var Buffer; Count: Integer): Integer; stdcall;
    procedure IgnoreStream; stdcall;
    function InitData(Data: Pointer; DataLen: Integer; CheckLen: Boolean): Integer; stdcall;
    property BytesReserved: Integer read GetBytesReserved;
    property Memory: Pointer read GetMemory;
    property Signature: Integer read GetSignature write SetSignature;
    property Size: Integer read GetSize write SetSize;
    property Stream: TStream read GetStream;
  public
    constructor Create;
    destructor Destroy; override;
  end;

  { TDataBlockInterpreter }

const

  { Action Signatures }

  CallSig         = $DA00; // Call signature
  ResultSig       = $DB00; // Result signature
  asError         = $01;   // Specify an exception was raised
  asInvoke        = $02;   // Specify a call to Invoke
  asGetID         = $03;   // Specify a call to GetIdsOfNames
  asCreateObject  = $04;   // Specify a com object to create
  asFreeObject    = $05;   // Specify a dispatch to free
  asGetServers    = $10;   // Get classname list
  asGetGUID       = $11;   // Get GUID for ClassName
  asGetAppServers = $12;   // Get AppServer classname list
  asSoapCommand   = $14;   // Soap command
  asMask          = $FF;   // Mask for action

type

  PIntArray = ^TIntArray;
  TIntArray = array[0..0] of Integer;

  PVariantArray = ^TVariantArray;
  TVariantArray = array[0..0] of OleVariant;

  TVarFlag = (vfByRef, vfVariant);
  TVarFlags = set of TVarFlag;

  EInterpreterError = class(Exception);

  TDataDispatch = class;


  TCustomDataBlockInterpreter = class
  protected
    procedure AddDispatch(Value: TDataDispatch); virtual; abstract;
    procedure RemoveDispatch(Value: TDataDispatch); virtual; abstract;

    { Sending Calls }
    procedure CallFreeObject(DispatchIndex: Integer); virtual; abstract;
    function CallGetIDsOfNames(DispatchIndex: Integer; const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; virtual; stdcall; abstract;
    function CallInvoke(DispatchIndex, DispID: Integer; const IID: TGUID; LocaleID: Integer;
      Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; virtual; stdcall; abstract;
    function CallGetServerList: OleVariant; virtual; abstract;

    { Receiving Calls }


    function InternalCreateObject(const ClassID: TGUID): OleVariant; virtual; abstract;
    function CreateObject(const Name: string): OleVariant; virtual; abstract;
    function StoreObject(const Value: OleVariant): Integer; virtual; abstract;
    function LockObject(ID: Integer): IDispatch; virtual; abstract;
    procedure UnlockObject(ID: Integer; const Disp: IDispatch); virtual; abstract;
    procedure ReleaseObject(ID: Integer); virtual; abstract;
    function CanCreateObject(const ClassID: TGUID): Boolean; virtual; abstract;
    function CallCreateObject(Name: string): OleVariant;  virtual;  abstract;
  public
    procedure InterpretData(const Data: IDataBlock); virtual; abstract;
  end;


  { TBinary... }
  TDataBlockInterpreter = class(TCustomDataBlockInterpreter)
  protected
    FDispatchList: TList;
    FDispList: OleVariant;
    FSendDataBlock: ISendDataBlock;
    FCheckRegValue: string;
    function GetVariantPointer(const Value: OleVariant): Pointer;
    procedure CopyDataByRef(const Source: TVarData; var Dest: TVarData);
    function ReadArray(VType: Integer; const Data: IDataBlock): OleVariant;
    procedure WriteArray(const Value: OleVariant; const Data: IDataBlock);
    function ReadVariant(out Flags: TVarFlags; const Data: IDataBlock): OleVariant;
    procedure WriteVariant(const Value: OleVariant; const Data: IDataBlock);
    procedure DoException(const Data: IDataBlock); virtual;
  protected
    procedure AddDispatch(Value: TDataDispatch); override;
    procedure RemoveDispatch(Value: TDataDispatch); override;
    function InternalCreateObject(const ClassID: TGUID): OleVariant; override;
    function CreateObject(const Name: string): OleVariant; override;
    function StoreObject(const Value: OleVariant): Integer; override;
    function LockObject(ID: Integer): IDispatch; override;
    procedure UnlockObject(ID: Integer; const Disp: IDispatch); override;
    procedure ReleaseObject(ID: Integer); override;
    function CanCreateObject(const ClassID: TGUID): Boolean; override;

    {Sending Calls}
    procedure CallFreeObject(DispatchIndex: Integer); override;
    function CallGetIDsOfNames(DispatchIndex: Integer; const IID: TGUID; Names: Pointer;
      NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; override;
    function CallInvoke(DispatchIndex, DispID: Integer; const IID: TGUID; LocaleID: Integer;
      Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult;  override;
    function CallGetServerList: OleVariant; override;

    {Receiving Calls}
    procedure DoCreateObject(const Data: IDataBlock);
    procedure DoFreeObject(const Data: IDataBlock);
    procedure DoGetIDsOfNames(const Data: IDataBlock);
    procedure DoInvoke(const Data: IDataBlock);

    function DoCustomAction(Action: Integer; const Data: IDataBlock): Boolean; virtual;
    
    procedure DoGetAppServerList(const Data: IDataBlock);
    procedure DoGetServerList(const Data: IDataBlock);

  public
    constructor Create(SendDataBlock: ISendDataBlock; CheckRegValue: string);virtual;
    destructor Destroy; override;
    function CallCreateObject(Name: string): OleVariant;  override;
    procedure InterpretData(const Data: IDataBlock); override;
  end;

{ TDataDispatch }

  TDataDispatch = class(TInterfacedObject, IDispatch)
  private
    FDispatchIndex: Integer;
    FInterpreter: TCustomDataBlockInterpreter;
  protected
    property DispatchIndex: Integer read FDispatchIndex;
    { IDispatch }
    function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
    function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
    function GetIDsOfNames(const IID: TGUID; Names: Pointer;
      NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
    function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
      Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
  public
    constructor Create(Interpreter: TCustomDataBlockInterpreter; DispatchIndex: Integer);
    destructor Destroy; override;
  end;

  { TTransportThread }

const
  THREAD_SENDSTREAM       = WM_USER + 1;
  THREAD_RECEIVEDSTREAM   = THREAD_SENDSTREAM + 1;
  THREAD_EXCEPTION        = THREAD_RECEIVEDSTREAM + 1;
  THREAD_SENDNOTIFY       = THREAD_EXCEPTION + 1;
  THREAD_REPLACETRANSPORT = THREAD_SENDNOTIFY + 1;

type

  TTransportThread = class(TThread)
  private
    FParentHandle: THandle;
    FSemaphore: THandle;
    FTransport: ITransport;
  public
    constructor Create(AHandle: THandle; Transport: ITransport); virtual;
    destructor Destroy; override;
    property Semaphore: THandle read FSemaphore;
    procedure Execute; override;
  end;

  { TStreamedConnection }

  TStreamedConnection = class({TDispatchConnection}TComponent, ISendDataBlock)
  private
    FRefCount: Integer;
    FHandle: THandle;
    FTransport: TTransportThread;
    FTransIntf: ITransport;
    FInterpreter: TCustomDataBlockInterpreter;
    FSupportCallbacks: Boolean;
    FInterceptGUID: TGUID;
    FInterceptName: string;

    FStreamedConnected: Boolean;

    FAfterConnect: TNotifyEvent;
    FAfterDisconnect: TNotifyEvent;
    FBeforeConnect: TNotifyEvent;
    FBeforeDisconnect: TNotifyEvent;
    FOnLogin: TLoginEvent;
    FLoginPrompt: Boolean;


    function GetHandle: THandle;
    procedure TransportTerminated(Sender: TObject);
    procedure SetSupportCallbacks(Value: Boolean);
    procedure SetInterceptName(const Value: string);
    function GetInterceptGUID: string;
    procedure SetInterceptGUID(const Value: string);
    procedure SetConnected(Value: Boolean);
  protected
    {cw.}
    FConnected : boolean;
    function GetConnected: Boolean;

    { IUnknown }
    function QueryInterface(const IID: TGUID; out Obj): HResult; reintroduce; stdcall;
    function _AddRef: Integer; stdcall;
    function _Release: Integer; stdcall;
    { ISendDataBlock }
    function Send(const Data: IDataBlock; WaitForResult: Boolean): IDataBlock; stdcall;

    procedure InternalOpen; virtual;
    procedure InternalClose; virtual;

    procedure ThreadReceivedStream(var Message: TMessage); message THREAD_RECEIVEDSTREAM;
    procedure ThreadException(var Message: TMessage); message THREAD_EXCEPTION;
    procedure WndProc(var Message: TMessage);
    function CreateTransport: ITransport; virtual;
    procedure DoConnect;virtual;
    procedure DoDisconnect;
    procedure DoError(E: Exception); virtual;

    function GetInterpreter: TCustomDataBlockInterpreter; virtual;

    property Interpreter: TCustomDataBlockInterpreter read GetInterpreter;
    property Handle: THandle read GetHandle;
    property SupportCallbacks: Boolean read FSupportCallbacks write SetSupportCallbacks default True;
    property InterceptGUID: string read GetInterceptGUID write SetInterceptGUID;
    property InterceptName: string read FInterceptName write SetInterceptName;
  public
    function GetInterceptorList: OleVariant; virtual;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    property Connected: Boolean read GetConnected write SetConnected default False;
    property LoginPrompt: Boolean read FLoginPrompt write FLoginPrompt default False;
    property AfterConnect: TNotifyEvent read FAfterConnect write FAfterConnect;
    property BeforeConnect: TNotifyEvent read FBeforeConnect write FBeforeConnect;
    property AfterDisconnect: TNotifyEvent read FAfterDisconnect write FAfterDisconnect;
    property BeforeDisconnect: TNotifyEvent read FBeforeDisconnect write FBeforeDisconnect;
    property OnLogin: TLoginEvent read FOnLogin write FOnLogin;

  end;

  { TSocketTransport }

  ESocketConnectionError = class(Exception);

  TSocketTransport = class(TInterfacedObject, ITransport)
  private
    FEvent: THandle;
    FAddress: string;
    FHost: string;
    FPort: Integer;
    FClientSocket: TClientSocket;
    FSocket: TCustomWinSocket;
    FInterceptGUID: string;
    FInterceptor: IDataIntercept;
    FCreateAttempted: Boolean;
    function CheckInterceptor: Boolean;
    procedure InterceptIncoming(const Data: IDataBlock);
    procedure InterceptOutgoing(const Data: IDataBlock);
  protected
    { ITransport }
    function GetWaitEvent: THandle; stdcall;
    function GetConnected: Boolean; stdcall;
    procedure SetConnected(Value: Boolean); stdcall;
    function Receive(WaitForInput: Boolean; Context: Integer): IDataBlock; stdcall;
    function Send(const Data: IDataBlock): Integer; stdcall;
  public
    constructor Create;
    destructor Destroy; override;
    property Host: string read FHost write FHost;
    property Address: string read FAddress write FAddress;
    property Port: Integer read FPort write FPort;
    property Socket: TCustomWinSocket read FSocket write FSocket;
    property InterceptGUID: string read FInterceptGUID write FInterceptGUID;
  end;

  { TSocketConnection }

  TSocketConnection = class(TStreamedConnection)
  private
    FAddress: string;
    FHost: string;
    FPort: Integer;
    procedure SetAddress(Value: string);
    procedure SetHost(Value: string);
    function IsHostStored: Boolean;
    function IsAddressStored: Boolean;
  protected
    function CreateTransport: ITransport; override;
    procedure DoConnect; override;
  public
    constructor Create(AOwner: TComponent); override;
  published
    property Address: string read FAddress write SetAddress stored IsAddressStored;
    property Host: string read FHost write SetHost stored IsHostStored;
    property InterceptGUID;
    property InterceptName;
    property Port: Integer read FPort write FPort default 211;
    property SupportCallbacks;
//    property ObjectBroker;
  end;


  { TPacketInterceptFactory }

  TPacketInterceptFactory = class(TComObjectFactory)
  public
    procedure UpdateRegistry(Register: Boolean); override;
  end;
  {$EXTERNALSYM TPacketInterceptFactory}

{ Utility functions }

function LoadWinSock2: Boolean;
procedure GetPacketInterceptorList(List: TStringList);

var
  WSACreateEvent: function: THandle stdcall;
  WSAResetEvent: function(hEvent: THandle): Boolean stdcall;
  WSACloseEvent: function(hEvent: THandle): Boolean stdcall;
  WSAEventSelect: function(s: TSocket; hEventObject: THandle; lNetworkEvents: Integer): Integer stdcall;

implementation

uses
  ActiveX, MidConst, RTLConsts;

var

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜在线观看视频在线| 麻豆成人免费电影| 曰韩精品一区二区| 亚洲成人久久影院| 日韩精品乱码免费| 国产福利一区二区三区视频在线| av在线不卡网| 欧美嫩在线观看| 精品国产sm最大网站免费看| 国产精品欧美经典| 婷婷久久综合九色国产成人| 国产盗摄一区二区| 欧美色视频在线观看| 精品人在线二区三区| 国产精品高潮呻吟| 蜜臀av国产精品久久久久| 国产成人亚洲综合a∨猫咪| 91免费国产视频网站| 日韩片之四级片| 中文字幕免费不卡在线| 亚洲国产视频一区二区| 日本美女一区二区| 97久久超碰精品国产| 日韩视频在线永久播放| 亚洲视频一区二区在线| 激情综合色综合久久综合| 欧洲人成人精品| 久久久精品免费网站| 亚洲国产欧美在线人成| 成人毛片老司机大片| 日韩欧美亚洲国产另类| 一区二区三区四区蜜桃| 国产成人午夜精品5599| 99精品国产91久久久久久| www激情久久| 蜜臀精品久久久久久蜜臀| 欧美亚洲一区二区在线观看| 欧美国产丝袜视频| 激情综合网av| 欧美一区二区三区爱爱| 亚洲午夜一区二区| 99国内精品久久| 中文字幕亚洲在| 成人午夜碰碰视频| 久久久高清一区二区三区| 卡一卡二国产精品| 欧美丰满少妇xxxbbb| 夜夜操天天操亚洲| 一本色道久久综合亚洲91| 国产精品成人午夜| 成人高清av在线| 久久久99久久精品欧美| 蜜桃久久久久久久| 日本精品一区二区三区高清| 中文字幕在线免费不卡| www.在线成人| 亚洲天天做日日做天天谢日日欢 | 日韩一区中文字幕| 丁香六月久久综合狠狠色| 久久久久久97三级| www.日韩在线| 亚洲男同1069视频| 欧美主播一区二区三区| 亚洲一区二区三区在线| 欧美在线一二三| 午夜精品视频一区| 91精选在线观看| 久久精品国产久精国产爱| 欧美电视剧免费观看| 国内精品在线播放| 欧美国产一区在线| 成人app网站| 一区二区三区四区av| 欧美在线一二三| 青娱乐精品在线视频| 欧美xxxx老人做受| 不卡的av中国片| 性感美女极品91精品| 日韩欧美的一区| 91视频在线观看| 日韩中文字幕麻豆| 久久综合狠狠综合久久综合88| 国产一区二区三区四区五区美女| 欧美激情一区二区三区不卡 | 不卡电影免费在线播放一区| 国产精品久久久久久福利一牛影视 | 亚洲乱码国产乱码精品精的特点| 色综合视频一区二区三区高清| 首页国产欧美久久| 久久久久久久精| 欧美三级电影在线看| 国产综合色产在线精品| 日韩美女精品在线| 91精品国产日韩91久久久久久| 国产成人av电影在线观看| 一区二区三区蜜桃| 日本一区二区综合亚洲| 欧美色男人天堂| 粉嫩13p一区二区三区| 亚洲大型综合色站| 国产三区在线成人av| 欧美色成人综合| 狠狠色狠狠色综合系列| 亚洲欧美日韩国产综合在线| 日韩欧美一区二区不卡| 欧美网站一区二区| 成人午夜激情影院| 久久精品国产精品亚洲红杏| 夜夜精品视频一区二区| 中文一区二区在线观看| 91麻豆精品国产91久久久久久久久| 不卡视频一二三| 国产suv精品一区二区三区| 日本欧美一区二区三区乱码| 亚洲人成在线观看一区二区| 久久精品亚洲精品国产欧美| 色噜噜狠狠色综合欧洲selulu| 蜜臀av一区二区在线观看 | 麻豆视频一区二区| 亚洲一级二级三级在线免费观看| 国产女主播视频一区二区| 欧美日韩视频在线观看一区二区三区 | av电影在线不卡| 国产一二精品视频| 免费观看30秒视频久久| 国产精品你懂的| 久久婷婷综合激情| 欧美tickling网站挠脚心| 欧美一区二区三区视频在线观看| 欧美日韩在线一区二区| 91久久精品一区二区三| 91亚洲精品一区二区乱码| 成人午夜精品在线| www.亚洲精品| 91麻豆高清视频| 色婷婷国产精品| 高清久久久久久| 国产成人亚洲综合a∨猫咪| 国产最新精品精品你懂的| 久久99精品视频| 国产综合色产在线精品| 国内成人自拍视频| 国产精品一区二区三区乱码 | youjizz久久| 95精品视频在线| 色噜噜夜夜夜综合网| 欧美专区在线观看一区| 欧美美女视频在线观看| 欧美男男青年gay1069videost| 欧美日本在线看| 日韩欧美中文一区| 日韩欧美国产电影| 4438x亚洲最大成人网| 欧美一区二区三区免费在线看| 欧美一区二区福利视频| 精品国产3级a| 日本一区二区视频在线观看| 亚洲视频在线观看三级| 亚洲成年人影院| 麻豆精品久久精品色综合| 国产精品一区二区视频| 欧美二区在线观看| 国产精品久久久久影院亚瑟 | 国产成人在线观看| 欧美裸体bbwbbwbbw| 中文字幕乱码久久午夜不卡| 蜜桃视频免费观看一区| 欧美影院一区二区| 国产精品久久看| 狠狠色丁香久久婷婷综| 欧美在线观看一二区| 欧美激情综合在线| 美日韩一区二区三区| 在线精品视频免费播放| 中文字幕日韩一区| 国产麻豆视频一区| 日韩久久精品一区| 亚洲福利视频一区| 91福利视频久久久久| **欧美大码日韩| 国产成人综合网站| xf在线a精品一区二区视频网站| 亚洲123区在线观看| 91香蕉视频mp4| 综合精品久久久| 成人午夜视频网站| 久久久一区二区三区捆绑**| 久久成人免费日本黄色| 日韩一区二区三区免费看| 亚洲成人免费视| 91.com在线观看| 亚洲www啪成人一区二区麻豆| 色婷婷综合久久久| 伊人夜夜躁av伊人久久| 色婷婷激情综合| 亚洲成av人片在线| 7777女厕盗摄久久久| 久久精品噜噜噜成人88aⅴ| 日韩一区二区三区免费观看| 久久成人免费网|