+ import the module management win16 apis

git-svn-id: trunk@31541 -
This commit is contained in:
nickysn 2015-09-05 22:09:06 +00:00
parent 10a01c0127
commit 203d26af4b
2 changed files with 56 additions and 0 deletions

View File

@ -66,6 +66,41 @@ procedure Throw(var CatchBuf: TCatchBuf; ThrowBack: SmallInt); external 'KERNEL'
procedure SwitchStackBack; external 'KERNEL';
procedure SwitchStackTo(StackSegment, StackPointer, StackTop: UINT); external 'KERNEL';
{ Module Management }
function LoadModule(ModuleName: LPCSTR; ParameterName: LPVOID): HINST; external 'KERNEL';
function FreeModule(Module: HINST): BOOL; external 'KERNEL';
function LoadLibrary(LibFileName: LPCSTR): HINST; external 'KERNEL';
procedure FreeLibrary(LibModule: HINST); external 'KERNEL';
function WinExec(CmdLine: LPCSTR; CmdShow: UINT): UINT; external 'KERNEL';
function GetModuleHandle(ModuleName: LPCSTR): HMODULE; external 'KERNEL';
function GetModuleUsage(Module: HINST): SmallInt; external 'KERNEL';
function GetModuleFileName(Module: HINST; FileName: LPSTR; Size: SmallInt): SmallInt; external 'KERNEL';
function GetProcAddress(Module: HINST; ProcName: LPCSTR): FARPROC; external 'KERNEL';
function GetInstanceData(Instance: HINST; Data: PBYTE; Count: SmallInt): SmallInt; external 'KERNEL';
function GetCodeHandle(Proc: FARPROC): HGLOBAL; external 'KERNEL';
procedure GetCodeInfo(lpProc: FARPROC; lpSegInfo: LPSEGINFO); external 'KERNEL';
function MakeProcInstance(Proc: FARPROC; Instance: HINST): FARPROC; external 'KERNEL';
procedure FreeProcInstance(Proc: FARPROC); external 'KERNEL';
{#ifdef _LAX
#define MakeProcInstance(__F, __H) MakeProcInstance((FARPROC)__F, __H)
#define FreeProcInstance(__F) FreeProcInstance((FARPROC)__F)
#endif /* _LAX */}
function SetSwapAreaSize(Size: UINT): LONG; external 'KERNEL';
procedure SwapRecording(Flag: UINT); external 'KERNEL';
procedure ValidateCodeSegments; external 'KERNEL';
implementation
function LOBYTE(w: Word): Byte;

View File

@ -93,6 +93,27 @@ type
PCatchBuf = ^TCatchBuf;
TCatchBuf = CATCHBUF;
const
HINSTANCE_ERROR = HINST(32);
{ Windows Exit Procedure flag values }
WEP_SYSTEM_EXIT = 1;
WEP_FREE_DLL = 0;
type
LPSEGINFO = ^SEGINFO; far;
SEGINFO = record
offSegment: UINT;
cbSegment: UINT;
flags: UINT;
cbAlloc: UINT;
h: HGLOBAL;
alignShift: UINT;
reserved: array [0..1] of UINT;
end;
PSegInfo = ^TSegInfo;
TSegInfo = SEGINFO;
implementation
end.