xref: /reactos/sdk/lib/conutils/utils.h (revision 34593d93)
1 /*
2  * PROJECT:     ReactOS Console Utilities Library
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     Base set of functions for loading string resources
5  *              and message strings, and handle type identification.
6  * COPYRIGHT:   Copyright 2017-2021 ReactOS Team
7  *              Copyright 2017-2021 Hermes Belusca-Maito
8  */
9 
10 /**
11  * @file    utils.h
12  * @ingroup ConUtils
13  *
14  * @brief   General-purpose utility functions (wrappers around
15  *          or reimplementations of Win32 APIs).
16  **/
17 
18 #ifndef __UTILS_H__
19 #define __UTILS_H__
20 
21 #pragma once
22 
23 #ifndef _UNICODE
24 #error The ConUtils library at the moment only supports compilation with _UNICODE defined!
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 INT
32 WINAPI
33 K32LoadStringExW(
34     IN  HINSTANCE hInstance OPTIONAL,
35     IN  UINT   uID,
36     IN  LANGID LanguageId,
37     OUT LPWSTR lpBuffer,
38     IN  INT    nBufferMax);
39 
40 INT
41 WINAPI
42 K32LoadStringW(
43     IN  HINSTANCE hInstance OPTIONAL,
44     IN  UINT   uID,
45     OUT LPWSTR lpBuffer,
46     IN  INT    nBufferMax);
47 
48 DWORD
49 WINAPI
50 FormatMessageSafeW(
51     IN  DWORD   dwFlags,
52     IN  LPCVOID lpSource OPTIONAL,
53     IN  DWORD   dwMessageId,
54     IN  DWORD   dwLanguageId,
55     OUT LPWSTR  lpBuffer,
56     IN  DWORD   nSize,
57     IN  va_list *Arguments OPTIONAL);
58 
59 LANGID
60 ConSetThreadUILanguage(
61     IN LANGID LangId OPTIONAL);
62 
63 BOOL
64 IsTTYHandle(IN HANDLE hHandle);
65 
66 BOOL
67 IsConsoleHandle(IN HANDLE hHandle);
68 
69 
70 // #include <wincon.h>
71 
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif  /* __UTILS_H__ */
78 
79 /* EOF */
80