亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲一区二区三区四区在线免费观看| 在线观看亚洲专区| 五月激情丁香一区二区三区| 亚洲人成影院在线观看| 国产欧美精品一区| 国产女人18毛片水真多成人如厕 | 亚洲第一福利视频在线| 亚洲视频在线观看一区| 亚洲免费伊人电影| 亚洲午夜久久久久久久久电影院| 亚洲精品欧美激情| 亚洲夂夂婷婷色拍ww47| 午夜婷婷国产麻豆精品| 首页亚洲欧美制服丝腿| 日韩av午夜在线观看| 久久成人麻豆午夜电影| 精品在线播放午夜| 国产91富婆露脸刺激对白| 成人动漫视频在线| 欧美体内she精视频| 这里是久久伊人| 日韩写真欧美这视频| 久久久www免费人成精品| 国产精品美女久久久久久2018| 成人欧美一区二区三区| 午夜精品久久久| 精品在线播放免费| 一本一本大道香蕉久在线精品 | 欧美喷潮久久久xxxxx| 欧美精品三级日韩久久| 精品国产91九色蝌蚪| 中文字幕免费不卡在线| 亚洲一级电影视频| 麻豆成人久久精品二区三区红| 国产成人精品免费网站| 欧美亚洲图片小说| 久久日韩粉嫩一区二区三区| 一区二区三区久久久| 国产一区在线看| 97se狠狠狠综合亚洲狠狠| 9191久久久久久久久久久| 中文字幕第一页久久| 亚洲不卡av一区二区三区| 国产毛片一区二区| 欧美日韩一本到| 久久精品亚洲一区二区三区浴池 | 日韩视频免费观看高清在线视频| 国产日本欧洲亚洲| 水蜜桃久久夜色精品一区的特点| 高清成人免费视频| 日韩欧美成人激情| 亚洲午夜免费电影| 99视频一区二区| 久久综合一区二区| 日韩激情视频在线观看| 99国产精品久久久| 欧美精品一区二区三区很污很色的| 亚洲另类春色校园小说| 丁香天五香天堂综合| 日韩一区二区三区电影 | 亚洲国产成人porn| 99re6这里只有精品视频在线观看| 欧美大黄免费观看| 丝袜亚洲精品中文字幕一区| 91福利社在线观看| 亚洲欧美日韩在线不卡| 成人午夜私人影院| 久久精品亚洲一区二区三区浴池| 日本视频中文字幕一区二区三区| 欧美视频你懂的| 最好看的中文字幕久久| 丁香亚洲综合激情啪啪综合| www亚洲一区| 精品一区二区三区在线视频| 日韩一区二区电影在线| 日韩中文欧美在线| 欧美午夜精品免费| 亚洲一区二区在线视频| 91福利视频网站| 一区二区三区在线免费播放| 在线免费视频一区二区| 一区二区欧美国产| 欧美综合在线视频| 亚洲va在线va天堂| 91麻豆精品国产91| 久久精品国产一区二区| 欧美r级在线观看| 国产一区二区精品久久| 欧美国产国产综合| 99久久er热在这里只有精品66| 亚洲天天做日日做天天谢日日欢| 在线视频中文字幕一区二区| 亚洲国产视频直播| 日韩三级视频在线观看| 国产精一区二区三区| 国产欧美精品区一区二区三区 | 国产精品传媒入口麻豆| 欧美一区二区精品| 人人超碰91尤物精品国产| 欧美日本一区二区| 日本不卡一二三| 精品日韩一区二区| 成人综合婷婷国产精品久久蜜臀| 国产精品传媒视频| 欧美日韩国产bt| 麻豆freexxxx性91精品| 国产日韩欧美激情| 色婷婷av一区二区三区软件| 日韩黄色免费网站| 久久久青草青青国产亚洲免观| 成人精品视频网站| 一个色综合网站| 日韩你懂的在线观看| 成人黄色国产精品网站大全在线免费观看 | 亚洲国产欧美在线| 日韩午夜在线观看| www.久久精品| 天天色 色综合| 国产日韩欧美a| 欧美美女视频在线观看| 国内成人免费视频| 一区二区三区欧美久久| 久久久电影一区二区三区| 色综合视频一区二区三区高清| 免费高清不卡av| 亚洲色图欧美偷拍| 久久嫩草精品久久久精品| 欧美午夜影院一区| 懂色av一区二区三区免费看| 午夜欧美2019年伦理| 中文字幕一区二区三区乱码在线 | 国内精品写真在线观看| 亚洲一区免费在线观看| 国产精品色一区二区三区| 欧美一个色资源| 欧洲国产伦久久久久久久| 成人激情电影免费在线观看| 毛片基地黄久久久久久天堂| 亚洲午夜羞羞片| 最新热久久免费视频| 久久先锋资源网| 欧美日韩国产不卡| 欧美午夜精品久久久久久孕妇| 成人网男人的天堂| 国产一区二区看久久| 精品一区二区国语对白| 美女久久久精品| 午夜久久电影网| 亚洲一区自拍偷拍| 亚洲自拍与偷拍| 亚洲精品国产a久久久久久| 中文字幕欧美激情一区| 久久精品视频免费| 久久久蜜桃精品| 精品久久久久久亚洲综合网 | 久久激情五月婷婷| 久久精品国产亚洲aⅴ| 日韩电影在线观看一区| 午夜精品在线看| 五月激情丁香一区二区三区| 性做久久久久久免费观看欧美| 亚洲一区二区三区不卡国产欧美| 亚洲一区二区精品3399| 亚洲二区在线视频| 日产精品久久久久久久性色| 日本三级亚洲精品| 激情成人午夜视频| 成人激情开心网| 色哟哟亚洲精品| 欧美日韩精品欧美日韩精品一 | 粉嫩av亚洲一区二区图片| 丁香桃色午夜亚洲一区二区三区| 国产精品18久久久久久久久久久久| 国产精品中文字幕日韩精品| 成人一级片网址| 91视频观看视频| 91国产免费看| 日韩小视频在线观看专区| 久久久国产精华| 亚洲欧美日韩系列| 亚洲v日本v欧美v久久精品| 麻豆精品国产91久久久久久 | 国产精品视频你懂的| 亚洲综合色区另类av| 日本aⅴ亚洲精品中文乱码| 精品一区二区国语对白| 91在线高清观看| 欧美一区二区三区在线| 国产亚洲欧洲997久久综合| 亚洲六月丁香色婷婷综合久久| 日日夜夜免费精品| 国产大陆亚洲精品国产| 欧美性视频一区二区三区| 日韩精品一区二区三区四区视频| 日本一区二区三区电影| 日韩影院在线观看| av一本久道久久综合久久鬼色| 6080日韩午夜伦伦午夜伦| 国产精品蜜臀在线观看| 奇米在线7777在线精品|