1
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by 440bx on Today at 05:37:30 pm »@paule32
you need to realize that you _cannot_ call WriteFile as it is documented in MSDN. In MSDN, WriteFile is defined as:The Pascal definition is NOT semantically equivalent because the "lpBuffer" parameter is _untyped_ and an untyped parameter is nowhere near what a "pointer" parameter is. The Pascal definition is _wrong_/_incorrect_, what makes it that way is that if you call WriteFile as it is documented in MSDN then you'll get an access violation because the Pascal definition is, again!, wrong!.
Either you correct the parameter by assigning it a type (which is the way it should be) or you call it in a way that can make that incorrect definition work properly.
The one thing you _cannot_ do is call the current Pascal definition as WriteFile is defined in MSDN. That will _never_ work.
By the way, if you want to call WriteFile the way it is documented in MSDN then you can use the definition I provided you a few posts back. Not only that would work, it's as easy as copy and paste (and define a constant for "kernel32".)
you need to realize that you _cannot_ call WriteFile as it is documented in MSDN. In MSDN, WriteFile is defined as:
- BOOL WriteFile(
- [in] HANDLE hFile,
- [in] LPCVOID lpBuffer,
- [in] DWORD nNumberOfBytesToWrite,
- [out, optional] LPDWORD lpNumberOfBytesWritten,
- [in, out, optional] LPOVERLAPPED lpOverlapped
- );
Either you correct the parameter by assigning it a type (which is the way it should be) or you call it in a way that can make that incorrect definition work properly.
The one thing you _cannot_ do is call the current Pascal definition as WriteFile is defined in MSDN. That will _never_ work.
By the way, if you want to call WriteFile the way it is documented in MSDN then you can use the definition I provided you a few posts back. Not only that would work, it's as easy as copy and paste (and define a constant for "kernel32".)