mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-21 19:05:16 +02:00
* patch by Sven Barth: Add CeRapiInvoke to rapi.pp, resolves #15170
git-svn-id: trunk@14482 -
This commit is contained in:
parent
4faf2e9f0f
commit
20995bb01b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5654,6 +5654,7 @@ packages/winceunits/src/pm.pp svneol=native#text/plain
|
||||
packages/winceunits/src/power.pp svneol=native#text/plain
|
||||
packages/winceunits/src/projects.pp svneol=native#text/plain
|
||||
packages/winceunits/src/rapi.pp svneol=native#text/plain
|
||||
packages/winceunits/src/rapitypes.pp svneol=native#text/plain
|
||||
packages/winceunits/src/ras.pp svneol=native#text/plain
|
||||
packages/winceunits/src/raserror.pp svneol=native#text/plain
|
||||
packages/winceunits/src/ril.pp svneol=native#text/plain
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/12/10]
|
||||
# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/12/26]
|
||||
#
|
||||
default: all
|
||||
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
|
||||
@ -268,7 +268,7 @@ override PACKAGE_NAME=winceunits
|
||||
override PACKAGE_VERSION=2.5.1
|
||||
WINDIR=../winunits-base/src
|
||||
ifeq ($(FULL_TARGET),i386-win32)
|
||||
override TARGET_UNITS+=rapi cesync
|
||||
override TARGET_UNITS+=rapi cesync rapitypes
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
override TARGET_UNITS+=comobj buildwinceunits
|
||||
@ -277,10 +277,10 @@ ifeq ($(FULL_TARGET),arm-wince)
|
||||
override TARGET_UNITS+=comobj buildwinceunits
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-wince)
|
||||
override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl bt_api bt_sdp bthapi bthutil pimstore ril sms ws2bth keybd nled phone connmgr devload devmgmt mmreg mmsystem msacm wininet ras raserror sip projects wap tsp extapi imm activex ole2 comconst
|
||||
override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl bt_api bt_sdp bthapi bthutil pimstore ril sms ws2bth keybd nled phone connmgr devload devmgmt mmreg mmsystem msacm wininet ras raserror sip projects wap tsp extapi imm activex ole2 comconst rapitypes
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),arm-wince)
|
||||
override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl bt_api bt_sdp bthapi bthutil pimstore ril sms ws2bth keybd nled phone connmgr devload devmgmt mmreg mmsystem msacm wininet ras raserror sip projects wap tsp extapi imm activex ole2 comconst
|
||||
override TARGET_IMPLICITUNITS+=aygshell commctrl commdlg iphlpapi notify oleauto power shellapi simmgr tapi gpsapi todaycmn windbase cesync gx winioctl msgqueue pm service htmlctrl sipapi cpl bt_api bt_sdp bthapi bthutil pimstore ril sms ws2bth keybd nled phone connmgr devload devmgmt mmreg mmsystem msacm wininet ras raserror sip projects wap tsp extapi imm activex ole2 comconst rapitypes
|
||||
endif
|
||||
ifeq ($(FULL_TARGET),i386-linux)
|
||||
override TARGET_RSTS+=comconst
|
||||
|
@ -13,9 +13,9 @@ implicitunits_wince=aygshell commctrl commdlg iphlpapi notify oleauto power shel
|
||||
sipapi cpl bt_api bt_sdp bthapi bthutil pimstore ril sms ws2bth keybd nled \
|
||||
phone connmgr devload devmgmt mmreg mmsystem msacm wininet ras raserror \
|
||||
sip projects wap tsp extapi imm \
|
||||
activex ole2 comconst
|
||||
activex ole2 comconst rapitypes
|
||||
|
||||
units_win32=rapi cesync
|
||||
units_win32=rapi cesync rapitypes
|
||||
|
||||
rsts=comconst
|
||||
|
||||
|
@ -25,7 +25,7 @@ uses
|
||||
gpsapi,todaycmn,windbase,cesync,gx,winioctl,msgqueue,pm,service,htmlctrl,
|
||||
sipapi, cpl, bt_api, bt_sdp, bthapi, bthutil, pimstore, ril, sms, ws2bth,
|
||||
keybd, nled, phone, connmgr, devload, devmgmt, mmreg, mmsystem, msacm,
|
||||
wininet, ras, raserror, sip, projects, wap, tsp, extapi, imm;
|
||||
wininet, ras, raserror, sip, projects, wap, tsp, extapi, imm, rapitypes;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -8,7 +8,7 @@ UNIT RAPI;
|
||||
|
||||
INTERFACE
|
||||
|
||||
uses Windows;
|
||||
uses Windows, RAPITypes;
|
||||
|
||||
const
|
||||
FAF_ATTRIBUTES = $00000001;
|
||||
@ -343,6 +343,8 @@ type
|
||||
TCeFindAllFiles = function(Path: PWideChar; Attr: DWORD; var Count: DWord;
|
||||
var FindData: PCe_Find_Data_array): BOOL stdcall;
|
||||
TRapiFreeBuffer = procedure(p: Pointer) stdcall;
|
||||
TCeRapiInvoke = function (pDllPath: LPCWSTR; pFunctionName: LPCWSTR; cbInput: DWord; pInput: PByte;
|
||||
pcbOutput: PDWord; ppOutput: PPByte; ppIRAPIStream: PIRAPIStream; dwReserved: DWord): HResult; stdcall;
|
||||
|
||||
function CeRapiInit: LongInt;
|
||||
function CeRapiInitEx(var RInit: TRapiInit) : LongInt;
|
||||
@ -435,6 +437,8 @@ function CeGetSystemPowerStatusEx(pStatus: PSYSTEM_POWER_STATUS_EX; fUpdate: BOO
|
||||
function DesktopToDevice(DesktopLocation, TableList: String; Sync: BOOL; Overwrite: Integer; DeviceLocation: String): Longint;
|
||||
//added 01/19/2003 - Octavio Hernandez
|
||||
function DeviceToDesktop(DesktopLocation, TableList: String; Sync: BOOL; Overwrite: Integer; DeviceLocation: String): Longint;
|
||||
function CeRapiInvoke(pDllPath: LPCWSTR; pFunctionName: LPCWSTR; cbInput: DWord; pInput: PByte;
|
||||
pcbOutput: PDWord; ppOutput: PPByte; ppIRAPIStream: PIRAPIStream; dwReserved: DWord): HResult;
|
||||
|
||||
IMPLEMENTATION
|
||||
|
||||
@ -506,6 +510,7 @@ var
|
||||
mDesktopToDevice: TDesktopToDevice;
|
||||
//added 01/19/2003 - Octavio Hernandez
|
||||
mDeviceToDesktop: TDeviceToDesktop;
|
||||
mCeRapiInvoke: TCeRapiInvoke;
|
||||
|
||||
RapiModule, AdoCEModule: THandle;
|
||||
|
||||
@ -588,6 +593,7 @@ begin
|
||||
@mCeGetClassName:= GetProcAddress(RapiModule, 'CeGetClassName');
|
||||
@mCeGlobalMemoryStatus:= GetProcAddress(RapiModule, 'CeGlobalMemoryStatus');
|
||||
@mCeGetSystemPowerStatusEx:= GetProcAddress(RapiModule, 'CeGetSystemPowerStatusEx');
|
||||
@mCeRapiInvoke:= GetProcAddress(RapiModule, 'CeRapiInvoke');
|
||||
end
|
||||
else
|
||||
Result := False;
|
||||
@ -1493,6 +1499,21 @@ begin
|
||||
Result := $FFFF;
|
||||
end;
|
||||
|
||||
function CeRapiInvoke(pDllPath: LPCWSTR; pFunctionName: LPCWSTR;
|
||||
cbInput: DWord; pInput: PByte; pcbOutput: PDWord; ppOutput: PPByte;
|
||||
ppIRAPIStream: PIRAPIStream; dwReserved: DWord): HResult;
|
||||
begin
|
||||
if not RapiLoaded then begin
|
||||
Result := $FFFF;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if @mCeRapiInvoke <> nil then
|
||||
Result := mCeRapiInvoke(pDllPath, pFunctionName, cbInput, pInput, pcbOutput, ppOutput, ppIRAPIStream, dwReserved)
|
||||
else
|
||||
Result := $FFFF;
|
||||
end;
|
||||
|
||||
INITIALIZATION
|
||||
RapiModule := 0;
|
||||
AdoCEModule := 0;
|
||||
|
42
packages/winceunits/src/rapitypes.pp
Normal file
42
packages/winceunits/src/rapitypes.pp
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 2009 Sven Barth.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
********************************************************************** }
|
||||
|
||||
{
|
||||
Types from rapitypes.h, others are directly in rapi.pp, but this unit is used
|
||||
from Win32 and WinCE.
|
||||
}
|
||||
unit RAPITypes;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
types;
|
||||
|
||||
type
|
||||
RAPISTREAMFLAG = (
|
||||
STREAM_TIMEOUT_READ
|
||||
);
|
||||
TRapiStreamFlag = RAPISTREAMFLAG;
|
||||
|
||||
IRAPIStream = interface(IStream)
|
||||
function SetRapiStat(Flag: RAPISTREAMFLAG; dwValue: DWord): HResult; stdcall;
|
||||
function GetRapiStat(Flag: RAPISTREAMFLAG; pdwValue: PDWord): HResult; stdcall;
|
||||
end;
|
||||
PIRAPIStream = ^IRAPIStream;
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user