1
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by KodeZwerg on Today at 12:03:11 am »how can I implement WriteFile ?By looking how microsoft has designed it to be.
- type
- DWORD = Cardinal;
- ULONG_PTR = {$IFDEF WIN32} Cardinal {$ENDIF} {$IFDEF WIN64} UInt64 {$ENDIF};
- LongBool = False..Boolean(4294967295);
- BOOL = LongBool;
- THandle = {$IFDEF WIN32} Cardinal {$ENDIF} {$IFDEF WIN64} UInt64 {$ENDIF};
- POverlapped = ^TOverlapped;
- _OVERLAPPED = record
- Internal: ULONG_PTR;
- InternalHigh: ULONG_PTR;
- Offset: DWORD;
- OffsetHigh: DWORD;
- hEvent: THandle;
- end;
- TOverlapped = _OVERLAPPED;
- // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile
- {BOOL WriteFile(
- [in] HANDLE hFile,
- [in] LPCVOID lpBuffer,
- [in] DWORD nNumberOfBytesToWrite,
- [out, optional] LPDWORD lpNumberOfBytesWritten,
- [in, out, optional] LPOVERLAPPED lpOverlapped
- );}
- // If the function succeeds, the return value is nonzero (TRUE).
- function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWORD; var lpNumberOfBytesWritten: DWORD; lpOverlapped: POverlapped): BOOL; stdcall; external 'kernel32.dll' name 'WriteFile';