ReactOS  0.4.14-dev-323-g6fe6a88
__crt_MessageBoxA.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS C runtime library
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * FILE: lib/sdk/crt/misc/__crt_MessageBoxA.c
5  * PURPOSE: __crt_MessageBoxA implementation
6  * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7  */
8 
9 #include <precomp.h>
10 
11 /*****************************************************************************
12  * \brief Displays a message box.
13  *
14  * \param pszText - The message to be displayed.
15  * \param uType - The contents and behavior of the message box.
16  * \return Identifies the button that was pressed by the user.
17  * \see MessageBox
18  *
19  *****************************************************************************/
20 int
21 __cdecl
23  _In_opt_ const char *pszText,
24  _In_ unsigned int uType)
25 {
26  HMODULE hmodUser32;
27  int (WINAPI *pMessageBoxA)(HWND, LPCTSTR, LPCTSTR, UINT);
28  int iResult;
29 
30  /* Get MessageBoxA function pointer */
31  hmodUser32 = LoadLibrary("user32.dll");
32  pMessageBoxA = (PVOID)GetProcAddress(hmodUser32, "MessageBoxA");
33  if (!pMessageBoxA)
34  {
35  abort();
36  }
37 
38  /* Display a message box */
39  iResult = pMessageBoxA(NULL,
40  pszText,
41  "ReactOS C Runtime Library",
42  uType);
43 
44  FreeLibrary(hmodUser32);
45  return iResult;
46 }
47 
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define LoadLibrary
Definition: winbase.h:3686
#define __cdecl
Definition: accygwin.h:79
HANDLE HWND
Definition: compat.h:13
#define _In_opt_
Definition: no_sal2.h:213
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
#define FreeLibrary(x)
Definition: compat.h:405
int __cdecl __crt_MessageBoxA(_In_opt_ const char *pszText, _In_ unsigned int uType)
#define WINAPI
Definition: msvc.h:8
#define _In_
Definition: no_sal2.h:204
#define abort()
Definition: i386-dis.c:35
unsigned int UINT
Definition: ndis.h:50
#define GetProcAddress(x, y)
Definition: compat.h:410
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31