亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲欧美日韩系列| 国产高清不卡一区二区| 免费人成网站在线观看欧美高清| 精品影院一区二区久久久| 成人黄色片在线观看| 日韩一区二区中文字幕| 亚洲欧美在线高清| 久久99精品久久久久久久久久久久| 日本精品视频一区二区| 精品国产制服丝袜高跟| 亚洲一二三四久久| 91丨porny丨蝌蚪视频| 久久女同互慰一区二区三区| 亚洲国产欧美在线人成| 99这里只有精品| 日本一区二区三区四区在线视频| 亚洲444eee在线观看| 色94色欧美sute亚洲线路一ni| 国产欧美日韩在线视频| 国模大尺度一区二区三区| 91精品国产综合久久精品app| 亚洲欧美偷拍另类a∨色屁股| 成人黄色软件下载| 中文乱码免费一区二区| 国产麻豆成人精品| 久久久久国产一区二区三区四区| 蜜臀va亚洲va欧美va天堂| 欧美另类z0zxhd电影| 亚洲国产成人91porn| 在线观看国产精品网站| 亚洲免费在线看| 色哟哟国产精品| 一区二区三区在线观看动漫| 色94色欧美sute亚洲线路一ni | 欧美在线免费播放| 亚洲青青青在线视频| 99久久久国产精品| 亚洲人成影院在线观看| 色哟哟精品一区| 午夜视频一区二区三区| 在线不卡中文字幕| 捆绑变态av一区二区三区| 日韩精品一区二区三区中文精品| 久久99精品网久久| 国产色产综合色产在线视频| 丁香婷婷综合五月| 亚洲免费av高清| 欧美美女网站色| 免费三级欧美电影| 久久你懂得1024| 91女神在线视频| 日韩精品成人一区二区在线| 91精品国产免费| 国产成人精品在线看| 亚洲欧美一区二区三区极速播放 | 国产丝袜在线精品| a4yy欧美一区二区三区| 一级中文字幕一区二区| 欧美另类久久久品| 国产乱码一区二区三区| 亚洲欧美日韩一区| 欧美一区二区视频在线观看2020 | 天使萌一区二区三区免费观看| 精品嫩草影院久久| av在线不卡电影| 日韩av电影天堂| 国产精品欧美一区二区三区| 91黄视频在线观看| 激情综合网激情| 亚洲黄色小视频| 欧美精品一区二区三区四区| 97久久超碰国产精品| 蜜桃视频一区二区三区| 中文字幕一区av| 精品美女在线播放| 欧美最猛黑人xxxxx猛交| 韩国精品一区二区| 亚洲综合色视频| 国产视频一区在线观看| 欧美少妇一区二区| 成人开心网精品视频| 日韩电影免费在线| 亚洲图片你懂的| 国产天堂亚洲国产碰碰| 91麻豆精品国产91久久久资源速度| 粉嫩一区二区三区在线看| 日本不卡1234视频| 亚洲一区在线视频| 国产午夜亚洲精品羞羞网站| 欧美一区二区三区公司| 在线日韩一区二区| 成人综合激情网| 精久久久久久久久久久| 日韩经典中文字幕一区| 亚洲久草在线视频| 国产精品美日韩| 精品欧美乱码久久久久久1区2区| 欧美乱熟臀69xxxxxx| 在线免费观看一区| 色94色欧美sute亚洲线路二| 成人免费电影视频| 国产馆精品极品| 国产一区二区三区综合| 蜜桃视频在线观看一区| 日韩二区三区四区| 丝袜亚洲另类丝袜在线| 午夜精品福利一区二区三区蜜桃| 亚洲欧美日韩国产综合| 国产精品久久久久一区二区三区共| 久久久精品tv| 久久久国际精品| 国产欧美视频一区二区三区| 国产亚洲午夜高清国产拍精品 | 国产精品资源站在线| 日韩精品视频网站| 午夜精品久久久久久久久| 亚洲国产精品久久久男人的天堂 | 一区二区三区欧美视频| 亚洲美女精品一区| 亚洲小说春色综合另类电影| 夜夜嗨av一区二区三区中文字幕 | 丁香六月综合激情| 丁香激情综合国产| 99re这里只有精品首页| 99久久综合99久久综合网站| 91丨porny丨国产入口| 91丨九色丨尤物| 欧美日本国产视频| 日韩视频免费观看高清完整版 | 久久综合九色综合欧美98| 久久亚洲精华国产精华液| 久久精品这里都是精品| 国产精品久久久久久久久免费樱桃 | 不卡在线观看av| 91国产视频在线观看| 欧美日韩国产高清一区二区| 欧美一区二区精品在线| 精品久久久久久久久久久院品网| 国产日韩欧美一区二区三区乱码| 国产精品第13页| 日日夜夜免费精品视频| 国产乱码精品一区二区三区av| av成人免费在线观看| 欧美日韩三级视频| 久久免费美女视频| 亚洲精品日日夜夜| 蜜桃视频在线观看一区| 成人黄色国产精品网站大全在线免费观看| 色综合天天性综合| 在线成人av网站| 国产精品情趣视频| 日本特黄久久久高潮| 成人app在线| 欧美一区二区成人6969| 欧美激情在线一区二区| 天天色天天操综合| 成人app在线观看| 日韩一区二区三区免费看| 国产精品久久久久久久久免费桃花| 午夜视频一区在线观看| 成人h动漫精品一区二| 在线成人av网站| 亚洲男人的天堂在线aⅴ视频| 精品一二三四区| 欧美乱熟臀69xxxxxx| 国产精品成人午夜| 国产乱色国产精品免费视频| 在线免费不卡电影| 国产精品国产三级国产aⅴ中文| 日本不卡的三区四区五区| 91丝袜高跟美女视频| 久久久精品国产免大香伊| 日韩二区三区在线观看| 欧美主播一区二区三区美女| 久久精品视频免费| 看片网站欧美日韩| 欧美一区二区三区在线看| 日韩伦理av电影| 成人免费av在线| 久久久久久久久久久黄色| 免费国产亚洲视频| 51精品视频一区二区三区| 一区二区高清免费观看影视大全| jlzzjlzz亚洲女人18| 国产午夜亚洲精品不卡| 黄一区二区三区| 欧美sm美女调教| 免费高清成人在线| 欧美日本在线播放| 亚洲国产视频一区| 欧美系列在线观看| 亚洲成人动漫一区| 欧美日韩精品专区| 亚洲不卡一区二区三区| 欧美在线观看一区二区| 亚洲国产精品一区二区www在线| 欧美伊人久久久久久久久影院| 一区二区日韩av| 欧美性一区二区| 日韩高清在线观看|