Using Microsoft Platform SDK Headers

RSXNT 1.5 supports September 99 Platform SDK

1) Download Platform SDK:

WWW address:

    http://msdn.microsoft.com/developer/sdk

and goto

Platform SDK Setup

You must follow the link “Platform SDK Setup„ (psdk-x86.exe). With this program you can choose files from the Platform SDK file description.

FTP Download:

ftp://ftp.microsoft.com/developr/PlatformSDK/win2k_rc2

2) Patching MSSDK Headers:

Set the environment MSSDK to the MSSDK directory.

SET MSSDK=C:\MSSDK

Run the batch DOPATCH.BAT from the directory \RSXNT\INCLUDE\MSSDK:

cd c:\rsxnt\include\mssdk
c:\rsxnt\include\mssdk> DOPATCH

The batch copies some files from \mssdk\include to \rsxnt\include\mssdk and then the program patch.exe is called to modify the files. The files in \mssdk\include will be not modified!

3) Change the include environments:

Now set your C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment:

First include the patched files from \RSXNT\INCLUDE\MSSDK and then the original files for \MSSDK\INCLUDE.

Example:

SET C_INCLUDE_PATH=C:\RSXNT\INCLUDE; C:\EMX\INCLUDE;

C:\RSXNT\INCLUDE\MSSDK; C:\MSSDK\INCLUDE

Patching other SDK include files:

There are some errors in the SDK include files for GNUC.

Case 1:

The GNU C++ compiler does not like the WINAPI (e.g. __stdcall) inside the function name.

Bad code:

    typedef void (WINAPI *FUNCTIONDEF)(void)

Good code:

    typedef void WINAPI (*FUNCTIONDEF)(void)

Case 2:

The GNU C++ compiler does not like the WINAPI (e.g. __stdcall) keyword if a function returns a pointer. The function attribute __stdcall should be placed before the pointer symbol.

Bad code:

    char * WINAPI Function(void);

Good code:

    char WINAPI * Function(void);

Summary:

Always write the keyword ‘WINAPI‚ after the first type keyword.

<struct or type> WINAPI < * > SYMBOL

Examples:

#include <wingnuc.h>

typedef void WINAPI (*Function1) (int);
typedef char WINAPI * (*Function2) (int);

void WINAPI * Function3 ();