Winapi

I have seen following declaration in the code. I have not seen such a declaration till now. Can you help me to understand?
static void WINAPI ServiceCtrlHandler(DWORD iControlCode);

what is WINAPI and it's significance?
[240 byte] By [adapanaidu] at [2007-11-20 11:25:10]
# 1 Re: Winapi
From MSDN: Obsolete Calling Conventions
Home | Overview | How Do I

The __pascal, __fortran, and __syscall calling conventions are no longer supported. You can emulate their functionality by using one of the supported calling conventions and appropriate linker options.

WINDOWS.H now supports the WINAPI macro, which translates to the appropriate calling convention for the target. Use WINAPI where you previously used PASCAL or __far __pascal.
General Data Types
Home | Overview | How Do I

The following table summarizes the new standard types defined in WINDOWS.H. These types are polymorphic (they can contain different kinds of data) and are generally useful throughout applications. Other new types, handles, and function pointers also are introduced in other topics (listed in New Types and Macros). Also seeSimple Types in the Win32 documentation.

Typedef Description
WINAPI
Use in place of FAR PASCAL in API declarations. If you are writing a DLL with exported API entry points, you can use this for your own APIs.

CALLBACK
Use in place of FAR PASCAL in application callback routines such as window procedures and dialog procedures.

LPCSTR
Same as LPSTR, except used for read-only string pointers. Defined as (const char FAR*).

UINT
Portable unsigned integer type whose size is determined by host environment (32 bits for Windows NT and Windows 95). Synonym for unsigned int. Used in place of WORD except in the rare cases where a 16-bit unsigned quantity is desired even on 32-bit platforms.

LRESULT
Type used for return value of window procedures.

LPARAM Type used for declaration of lParam, the fourth parameter of a windows procedure.

WPARAM
Type used for declaration of wParam, the third parameter of a windows procedure (a polymorphic data type).

LPVOID
Generic pointer type, equivalent to (void *). Should be used instead of LPSTR.
VictorN at 2007-11-9 13:32:43 >
# 2 Re: Winapi
Beside that Victor already stated.

WINAPI is an alias for __stdcall which is the calling convention used for Win32 API functions.
In fact, WINAPI is a macro defined in WINDEF.H as follows:
#define WINAPI __stdcall
See also Windows Data Types (http://msdn2.microsoft.com/en-us/library/aa383751.aspx) as well as __stdcall (http://msdn2.microsoft.com/en-us/library/zxk0tw93(VS.71).aspx)

[ Redirected thread ]
ovidiucucu at 2007-11-9 13:33:42 >