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

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

?? qtthunku.pas

?? 一個不錯的delphi 屏幕取詞程序!! 大家自己看吧我就不多說了
?? PAS
字號:
unit QTThunkU;

{$R-,S-,Q-}

//Define only one of these symbols
//If none are defined it defaults to original windows

{$DEFINE Generic} //Should work on all versions of Win95
   { $define OSR2}//Works on newer OSR2 versions
   { $define OSR1}//Works on original version of Win95

interface

uses
  Windows, SysUtils;

type
  THandle16 = Word;

//Windows 95 undocumented routines. These won't be found in Windows NT
{$IFDEF Generic}
var
  QT_Thunk: TProcedure;
{$ELSE}
procedure QT_Thunk;
{$ENDIF}
function LoadLibrary16(LibFileName: PChar): THandle; stdcall;
procedure FreeLibrary16(LibModule: THandle); stdcall;
function GetProcAddress16(Module: HModule; ProcName: PChar): TFarProc; stdcall;
function GlobalAlloc16(Flags: Integer; Bytes: Longint): THandle16; stdcall;
function GlobalFree16(Mem: THandle16): THandle16; stdcall;
function GlobalLock16(Mem: THandle16): Pointer; stdcall;
function GlobalUnLock16(Mem: THandle16): WordBool; stdcall;

//Windows NT/95 documented but undeclared routines

// 16:16 -> 0:32 Pointer translation.
//
// WOWGetVDMPointer will convert the passed in 16-bit address
// to the equivalent 32-bit flat pointer.  If fProtectedMode
// is TRUE, the function treats the upper 16 bits as a selector
// in the local descriptor table.  If fProtectedMode is FALSE,
// the upper 16 bits are treated as a real-mode segment value.
// In either case the lower 16 bits are treated as the offset.
//
// The return value is NULL if the selector is invalid.
//
// NOTE:  Limit checking is not performed in the retail build
// of Windows NT.  It is performed in the checked (debug) build
// of WOW32.DLL, which will cause NULL to be returned when the
// limit is exceeded by the supplied offset.
function WOWGetVDMPointer(vp, dwBytes: DWord;
  fProtectedMode: Bool): Pointer; stdcall;

// The following two functions are here for compatibility with
// Windows 95.  On Win95, the global heap can be rearranged,
// invalidating flat pointers returned by WOWGetVDMPointer, while
// a thunk is executing.  On Windows NT, the 16-bit VDM is completely
// halted while a thunk executes, so the only way the heap will
// be rearranged is if a callback is made to Win16 code.
//
// The Win95 versions of these functions call GlobalFix to
// lock down a segment's flat address, and GlobalUnfix to
// release the segment.
//
// The Windows NT implementations of these functions do *not*
// call GlobalFix/GlobalUnfix on the segment, because there
// will not be any heap motion unless a callback occurs.
// If your thunk does callback to the 16-bit side, be sure
// to discard flat pointers and call WOWGetVDMPointer again
// to be sure the flat address is correct.
function WOWGetVDMPointerFix(vp, dwBytes: DWord;
  fProtectedMode: Bool): Pointer; stdcall;
procedure WOWGetVDMPointerUnfix(vp: DWord); stdcall;

//My compound memory routines
function GlobalAllocPtr16(Flags: Word; Bytes: Longint): Pointer;
function GlobalAllocPointer16(Flags: Word; Bytes: Longint;
  var FlatPointer: Pointer; var Source; DataSize: Longint): Pointer;
function GlobalFreePtr16(P: Pointer): THandle16;

//My utility routines
function Ptr16To32(P: Pointer): Pointer;
function Ptr16To32Fix(P: Pointer): Pointer;
procedure Ptr16To32Unfix(P: Pointer);
function GetAddress16(Module: HModule; ProcName: string): TFarProc;

function LoadLib16(LibFileName: string): THandle;
function GDI16Handle: THandle;
function Kernel16Handle: THandle;
function User16Handle: THandle;

type
  TConvention = (ccPascal, ccCDecl);

function Call16BitRoutine(Name: string; DllHandle: THandle16;
  Convention: TConvention; Args: array of const;
  ArgSizes: array of Integer): Longint;

implementation

uses
  Classes, Dialogs;

type
  EInvalidArgument = class(EMathError);
  EInvalidProc = class(Exception);
  EThunkError = class(Exception);

const
  kernel32 = 'kernel32.dll';
  wow32 = 'wow32.dll';

//QT_Thunk changes its ordinal number under
//Windows 95 OSR2 so we link to it dynamically
//instead of statically, to ensure we get the right link
{$IFNDEF Generic}
{$IFDEF OSR2}
procedure QT_Thunk; external kernel32 index 561; //name 'QT_Thunk';
{$ELSE} {OSR1 - original Win95}
procedure QT_Thunk; external kernel32 index 559; //name 'QT_Thunk';
{$ENDIF}
{$ENDIF}
//Don't link by name to avoid ugly messages under NT
//These routines are exported with no names, hence the use of index
function LoadLibrary16; external kernel32 index 35;
procedure FreeLibrary16; external kernel32 index 36;
function GetProcAddress16; external kernel32 index 37;
function GlobalAlloc16; external kernel32 index 24;
function GlobalFree16; external kernel32 index 31;
function GlobalLock16; external kernel32 index 25;
function GlobalUnLock16; external kernel32 index 26;

//These routines are exported with names, hence the normal use of name
function WOWGetVDMPointer; external wow32 name 'WOWGetVDMPointer';
function WOWGetVDMPointerFix; external wow32 name 'WOWGetVDMPointerFix';
procedure WOWGetVDMPointerUnfix; external wow32 name 'WOWGetVDMPointerUnfix';

function GlobalAllocPtr16(Flags: Word; Bytes: Longint): Pointer;
begin
  Result := nil;
  //Ensure memory is fixed, meaning there is no need to lock it
  Flags := Flags or gmem_Fixed;
  LongRec(Result).Hi := GlobalAlloc16(Flags, Bytes);
end;

//16-bit pointer returned. FlatPointer is 32-bit pointer
//Bytes-sized buffer is allocated and then DataSize bytes
//from Source are copied in

function GlobalAllocPointer16(Flags: Word; Bytes: Longint;
  var FlatPointer: Pointer; var Source; DataSize: Longint): Pointer;
begin
  //Allocate memory in an address range
  //that _can_ be accessed by 16-bit apps
  Result := GlobalAllocPtr16(Flags, Bytes);
  //Get 32-bit pointer to this memory
  FlatPointer := Ptr16To32(Result);
  //Copy source data into the new bimodal buffer
  Move(Source, FlatPointer^, DataSize);
end;

function GlobalFreePtr16(P: Pointer): THandle16;
begin
  Result := GlobalFree16(LongRec(P).Hi);
end;

//Turn 16-bit pointer (selector and offset)
//into 32-bit pointer (offset)

function Ptr16To32(P: Pointer): Pointer;
begin
  Result := WOWGetVDMPointer(DWord(P), 0, True);
end;

//Turn 16-bit pointer (selector and offset)
//into 32-bit pointer (offset) and ensure it stays valid

function Ptr16To32Fix(P: Pointer): Pointer;
begin
  Result := WOWGetVDMPointerFix(DWord(P), 0, True);
end;

//Apply required housekeping to fixed 16-bit pointer

procedure Ptr16To32Unfix(P: Pointer);
begin
  WOWGetVDMPointerUnfix(DWord(P));
end;

function GetAddress16(Module: HModule; ProcName: string): TFarProc;
begin
  Result := GetProcAddress16(Module, PChar(ProcName));
  if not Assigned(Result) then
    raise EInvalidProc.Create('GetProcAddress16 failed');
end;

function LoadLib16(LibFileName: string): THandle;
begin
  Result := LoadLibrary16(PChar(LibFileName));
  if Result < HInstance_Error then
    raise EFOpenError.Create('LoadLibrary16 failed!');
end;

function GDI16Handle: THandle;
begin
  //Get GDI handle by loading it.
  Result := LoadLib16('GDI.EXE');
  //Free this particular load - GDI will stay in memory
  FreeLibrary16(Result);
end;

function Kernel16Handle: THandle;
begin
  //Get Kernel handle by loading it.
  Result := LoadLib16('KRNL386.EXE');
  //Free this particular load - Kernel will stay in memory
  FreeLibrary16(Result);
end;

function User16Handle: THandle;
begin
  //Get User handle by loading it.
  Result := LoadLib16('USER.EXE');
  //Free this particular load - User will stay in memory
  FreeLibrary16(Result);
end;

type
  TPtrSize = (ps16, ps32);

const
  //Max of 10 pointer params - no error checking yet
  MaxPtrs = 10;
  //Max of 1024 bytes passed, inc. indirectly - no error checking yet
  MaxParamBytes = 1024;

var
  ArgByteCount: Integer;
  ArgBuf: array[0..MaxParamBytes - 1] of Byte;
  ProcAddress: Pointer;

{$STACKFRAMES On}
{$OPTIMIZATION Off}

function CallQT_Thunk(Convention: TConvention): Longint;
var
  EatStackSpace: string[$3C];
begin
  //Ensure buffer isn't optimised away
  EatStackSpace := '';
  //Push ArgByteCount bytes from ArgBuf onto stack
  asm
    mov   edx, 0
  @LoopStart:
    cmp   edx, ArgByteCount
    je    @DoneStackBit
    mov   ax, word ptr [ArgBuf + edx]
    push  ax
    inc   edx
    inc   edx
    jmp   @LoopStart
  @DoneStackBit:
    mov   edx, ProcAddress
    call  QT_Thunk
    mov   Result.Word.0, ax
    mov   Result.Word.2, dx
    cmp   Convention, ccCDecl
    jne   @Exit
    add   esp, ArgByteCount
  @Exit:
  end;
end;
{$OPTIMIZATION On}

//DLL must already be loaded with LoadLib16 or LoadLibrary16
//The routine name and DLL handle are passed in, along with
//an indication of the calling convention (C or Pascal)
//Parameters are passed in an array. These can be 1, 2 or 4 byte
//ordinals, or pointers to anything.
//Parameter sizes are passed in a second array. If no parameters
//are required, pass a 0 in both arrays. There must be as
//many sizes as there are parameters. If the parameter is a pointer
//the size is the number of significant bytes it points to
//This routine returns a Longint. Consequently, valid return types
//for the target routine are 1, 2 or 4 byte ordinal types or
//pointers. Pointers returned will be 16-bit. These will need
//reading via Ptr16To32Fix and Ptr16To32Unfix

function Call16BitRoutine(Name: string; DllHandle: THandle16;
  Convention: TConvention; Args: array of const;
  ArgSizes: array of Integer): Longint;
var
  Loop: Integer;
  ByteTemp: Word;
  Ptrs: array[0..MaxPtrs - 1, TPtrSize] of Pointer;
  PtrCount: Byte;
  PtrArgIndices: array[0..MaxPtrs - 1] of integer; // maps Ptrs[] to
                                                    // original Args[]

  procedure PushParameter(Param: Integer);
  begin
    if ArgByteCount > MaxParamBytes then
      raise EThunkError.Create('Too many parameters');
    case Args[Param].VType of
      vtInteger, vtBoolean, vtChar:
        begin
        //Byte-sized args are passed as words
          if ArgSizes[Param] = 1 then
          begin
          //The important byte is stuck as msb of the 4
          //To get it into a word, assign it to one
            ByteTemp := Byte(Args[Param].VChar);
            Move(ByteTemp, ArgBuf[ArgByteCount], SizeOf(ByteTemp));
          //This means one extra byte on the stack
            Inc(ArgByteCount, 2);
          end
          else
          begin
          //If it's a 4 byte item, push the 2 high bytes
            if ArgSizes[Param] = 4 then
            begin
              Move(LongRec(Args[Param].VInteger).Hi,
                ArgBuf[ArgByteCount], SizeOf(Word));
              Inc(ArgByteCount, SizeOf(Word));
            end;
          //Either way, push the 2 low bytes
            Move(LongRec(Args[Param].VInteger).Lo,
              ArgBuf[ArgByteCount], SizeOf(Word));
            Inc(ArgByteCount, SizeOf(Word));
          end;
        end;
      vtPointer, vtPChar:
        begin
          if PtrCount = MaxPtrs then
            raise EThunkError.Create('Too many pointer parameters');
        //Must keep record of 16-bit and 32-bit
        //allocated pointers for terminal housekeeping
          Ptrs[PtrCount, ps16] := GlobalAllocPointer16(GPTR,
            ArgSizes[Param], Ptrs[PtrCount, ps32],
            Args[Param].vPointer^, ArgSizes[Param]);
        //Save arg position in arg list, may need
        //to copy back if arg is var
          PtrArgIndices[PtrCount] := Param;
        //Move high and low word of new pointer into ArgBuf
        //ready for push onto stack
          Move(LongRec(Ptrs[PtrCount, ps16]).Hi,
            ArgBuf[ArgByteCount], SizeOf(Word));
          Inc(ArgByteCount, SizeOf(Word));
          Move(LongRec(Ptrs[PtrCount, ps16]).Lo,
            ArgBuf[ArgByteCount], SizeOf(Word));
          Inc(ArgByteCount, SizeOf(Word));
          Inc(PtrCount);
        end;
    end;
  end;

begin
  //Check args
  if High(Args) <> High(ArgSizes) then
    raise EInvalidArgument.Create('Parameter mismatch');
  ArgByteCount := 0;
  PtrCount := 0;
  ProcAddress := GetProcAddress16(DLLHandle, PChar(Name));
  if not Assigned(ProcAddress) then
    raise EThunkError.Create('16-bit routine not found');
  //This should count up the number of bytes pushed
  //onto the stack. If Convention = ccCdecl, the stack
  //must be incremented that much after the routine ends
  //Also, parameters are pushed in reverse order if cdecl
  //Check for no parameters first
  if ArgSizes[Low(ArgSizes)] <> 0 then
    if Convention = ccPascal then
      for Loop := Low(Args) to High(Args) do
        PushParameter(Loop)
    else
      for Loop := High(Args) downto Low(Args) do
        PushParameter(Loop);
  Result := CallQT_Thunk(Convention);
  //Dispose of allocated pointers, copying
  //their contents back to 32-bit memory space
  //in case any data was updated by 16-bit code
  for Loop := 0 to Pred(PtrCount) do
  begin
    //Copy data back
    Move(Ptrs[Loop, ps32]^, Args[PtrArgIndices[Loop]].VPointer^,
      ArgSizes[PtrArgIndices[Loop]]);
    //Free pointer
    GlobalFreePtr16(Ptrs[Loop, ps16]);
  end;
end;

{$IFDEF Generic}
var
  Kernel32Mod: THandle;

initialization
  Kernel32Mod := GetModuleHandle('Kernel32.Dll');
  QT_Thunk := GetProcAddress(Kernel32Mod, 'QT_Thunk');
  if @QT_Thunk = nil then
    raise EThunkError.Create('Flat thunks only supported under Windows 95');
{$ELSE}
initialization
  if Win32Platform <> Ver_Platform_Win32_Windows then
    raise EThunkError.Create('Flat thunks only supported under Windows 95');
{$ENDIF}
end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩久久久精品| 亚洲制服欧美中文字幕中文字幕| 国产精品久久久久久久岛一牛影视| 亚洲女同一区二区| 国内精品在线播放| 在线成人午夜影院| 亚洲蜜臀av乱码久久精品| 国产精品自拍毛片| 日韩三级视频在线看| 亚洲va韩国va欧美va精品| www.欧美精品一二区| 2021中文字幕一区亚洲| 美女性感视频久久| 欧美日韩国产成人在线91| 亚洲精品成a人| 色婷婷亚洲精品| 亚洲欧美区自拍先锋| 成人性生交大片免费看视频在线| 精品免费日韩av| 青青国产91久久久久久| 欧美少妇xxx| 一区二区三区免费在线观看| 99国产欧美另类久久久精品| 国产欧美一区视频| 国产乱码精品一区二区三区忘忧草| 88在线观看91蜜桃国自产| 亚洲精品老司机| 91麻豆高清视频| 亚洲日本护士毛茸茸| 99精品欧美一区二区蜜桃免费 | 国产欧美日韩综合精品一区二区| 男男gaygay亚洲| 日韩欧美你懂的| 精品一区二区三区免费观看 | 亚洲最大色网站| 一本大道久久精品懂色aⅴ| 一区在线中文字幕| 91视频免费看| 亚洲最大成人综合| 欧美日韩精品是欧美日韩精品| 一区二区在线免费观看| 欧美影院一区二区| 天堂精品中文字幕在线| 91精品在线免费| 激情综合色播五月| 国产欧美综合色| 91在线小视频| 亚洲aaa精品| 日韩精品一区二区三区中文不卡| 免费看日韩a级影片| 久久久蜜桃精品| 99国产精品久久| 亚洲午夜一区二区三区| 日韩免费看网站| 国产91精品露脸国语对白| 亚洲三级电影全部在线观看高清| 欧美性大战xxxxx久久久| 精品一区二区三区在线视频| 国产色产综合产在线视频| 99久久99久久精品免费观看| 亚洲小少妇裸体bbw| 亚洲精品一区二区三区精华液 | 老司机精品视频在线| 久久一日本道色综合| 99re视频精品| 人妖欧美一区二区| 国产精品久久久久四虎| 欧美体内she精视频| 国产一区二区在线看| 亚洲欧美精品午睡沙发| 欧美电影免费观看高清完整版在线| 国产成人综合视频| 性感美女久久精品| 国产精品美女视频| 日韩三级视频中文字幕| 91蜜桃视频在线| 国产一区二区三区电影在线观看| 亚洲精品欧美专区| 国产日韩成人精品| 欧美精品aⅴ在线视频| www.日韩在线| 狠狠色综合播放一区二区| 一区二区不卡在线视频 午夜欧美不卡在| 91精品国产高清一区二区三区 | 26uuu另类欧美亚洲曰本| 成人深夜福利app| 麻豆国产一区二区| 一区二区在线观看av| 国产欧美一区二区在线| 欧美日韩国产成人在线免费| 成人av片在线观看| 久久99精品国产.久久久久| 亚洲国产视频a| 亚洲欧洲av色图| 久久久精品天堂| 欧美一二三在线| 欧美日韩综合一区| 91首页免费视频| 成人激情校园春色| 国产一区激情在线| 久草在线在线精品观看| 日韩精品高清不卡| 午夜不卡av免费| 亚洲一区二区三区爽爽爽爽爽| 国产精品美女www爽爽爽| 久久先锋影音av鲁色资源网| 日韩久久久久久| 日韩免费视频一区| 欧美刺激午夜性久久久久久久| 欧美巨大另类极品videosbest| 色999日韩国产欧美一区二区| av一区二区三区四区| 成人app在线| 99久久久久久| 一本大道久久精品懂色aⅴ| 91一区一区三区| 91久久精品一区二区二区| 色综合色综合色综合色综合色综合| 成人av网站在线观看| 91麻豆国产在线观看| 91国产免费观看| 欧美三级在线看| 欧美精品一二三| 日韩一二在线观看| www国产亚洲精品久久麻豆| 久久久99精品久久| 国产精品免费丝袜| 亚洲美女视频在线观看| 亚洲国产日韩在线一区模特| 亚洲成a人v欧美综合天堂| 婷婷亚洲久悠悠色悠在线播放| 日韩国产欧美在线观看| 精品在线亚洲视频| 国产精品亚洲成人| 91免费在线看| 欧美剧情电影在线观看完整版免费励志电影| 欧美日韩精品一区视频| 日韩欧美不卡一区| 日本一区二区电影| 亚洲综合一二三区| 久久精品国产在热久久| 成人激情小说网站| 欧美日韩一区二区三区在线 | 蜜臀av一区二区三区| 国产麻豆精品一区二区| 91网上在线视频| 91精品国产色综合久久ai换脸| 欧美精品一区二区蜜臀亚洲| 中文字幕日韩一区二区| 亚洲亚洲人成综合网络| 国产一区二区影院| 91污在线观看| 337p日本欧洲亚洲大胆色噜噜| 国产精品久久久久影视| 日韩国产一二三区| a美女胸又www黄视频久久| 日韩精品一区国产麻豆| 亚洲精品国产高清久久伦理二区| 日韩中文字幕不卡| 成人美女在线观看| 日韩一级欧美一级| 亚洲免费在线播放| 国产精品伊人色| 欧美日韩亚洲综合| 中文字幕中文字幕一区| 麻豆91在线看| 欧美日韩一二三| 亚洲色欲色欲www| 国产一区二区精品久久99| 欧美三级在线视频| 亚洲男人的天堂在线aⅴ视频| 激情丁香综合五月| 在线电影院国产精品| 一区二区三区在线看| 成人一区二区三区视频在线观看| 7777精品伊人久久久大香线蕉最新版 | 国产酒店精品激情| 欧美一区二区三区四区视频| 亚洲黄色在线视频| 成人丝袜18视频在线观看| 日韩精品中文字幕在线一区| 亚洲制服欧美中文字幕中文字幕| 波多野结衣视频一区| 国产亚洲一区二区三区四区 | 亚洲午夜久久久久久久久电影网| 国产精品12区| 337p日本欧洲亚洲大胆色噜噜| 伦理电影国产精品| 欧美一区二区久久久| 日日夜夜精品免费视频| 欧美在线一二三| 亚洲激情图片小说视频| 91免费观看视频在线| 中文字幕在线不卡一区二区三区| 国产精品一线二线三线精华| 精品久久久久香蕉网| 经典一区二区三区| 精品人在线二区三区| 激情综合五月天| 久久日一线二线三线suv|