function GetFeeSystemResources(SysResource: Word):Word; var
EatStackSpace: String[$3C]; begin // Ensure buffer isn't optimised away
EatStackSpace := ''; @GetFSR:=GetProcAddress16(User16Handle,'GETFREESYSTEMRESOURCES'); if Assigned(GetFSR) then//Test result for nil asm //Manually push onto the stack type of resource to be checked first
push SysResource //Load routine address into EDX
mov edx, [GetFSR] //Call routine
call QT_Thunk //Assign result to the function
mov @Result, ax end elseraise EFOpenError.Create('GetProcAddress16 failed!'); end;
initialization
//Check Platform for Windows 9x if Win32Platform <> VER_PLATFORM_WIN32_WINDOWS then
raise EThunkError.Create('Flat thunks only supported under Windows 9x');