Reputation: 5114
I'm using several function of the Win32 API, but the MSDN don't tell me from which Windows version they originate, their history horizon is just Win2K now (as seen in the ReadFile function documentation).
As the code may have to work on NT4 or win9x, I would like to know if I have to put in place a 'graceful' fall-back if these functions are not present on the system. So does anyone got some information about the introduction date/version of the following functions :
Thanks
Upvotes: 1
Views: 395
Reputation: 941455
These API functions have existed since the first release of the Win32 API, back in ~1993. No need to write special code.
If you intend to target ancient operating systems like NT4 and Win95 you will however have to pay a visit to the Microsoft Museum to find an old version of both the SDK and the compiler. SDK and compiler releases for at least the past 6 years are compatible only with Windows 2000 and up. Finding these versions might be harder than it looks, the settlement with Sun made it illegal for Microsoft to still distribute version 5 and 6 of Visual Studio. You'll have to go back at least to version 4.2. It has been a long time since I've seen anybody willing to put up with the cost of supporting such ancient relics.
Upvotes: 2
Reputation: 26
The following are cut-n-pastes from the msdn docs installed with visual studio 2005. I include the function signatures so you can verify that we are talking about the same functions.
-----
BOOL CreatePipe(
PHANDLE hReadPipe,
PHANDLE hWritePipe,
LPSECURITY_ATTRIBUTES lpPipeAttributes,
DWORD nSize
);
Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header: Declared in Winbase.h; include Windows.h.
Library: Link to Kernel32.lib.
DLL: Requires Kernel32.dll.
-----
BOOL SetHandleInformation(
HANDLE hObject,
DWORD dwMask,
DWORD dwFlags
);
Client: Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 3.51 and later.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 3.51 and later.
Header: Declared in Winbase.h; include Windows.h.
Library: Link to Kernel32.lib.
DLL: Requires Kernel32.dll.
-----
BOOL PeekNamedPipe(
HANDLE hNamedPipe,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesRead,
LPDWORD lpTotalBytesAvail,
LPDWORD lpBytesLeftThisMessage
);
Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header: Declared in Winbase.h; include Windows.h.
Library: Link to Kernel32.lib.
DLL: Requires Kernel32.dll.
Upvotes: 1