mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 12:45:16 +00:00
[CONSRV]
Add diagnostics ASSERTs for MultiByteToWideChar & its companion (the source and target pointers must not be the same, otherwise it doesn't work). svn path=/branches/condrv_restructure/; revision=63764
This commit is contained in:
parent
19e30db97b
commit
6f772ac651
|
@ -70,6 +70,14 @@ ConvertInputUnicodeToAnsi(PCONSOLE Console,
|
|||
{
|
||||
ASSERT(Source && Target && TargetLength);
|
||||
|
||||
/*
|
||||
* From MSDN:
|
||||
* "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
|
||||
* If they are the same, the function fails, and GetLastError returns
|
||||
* ERROR_INVALID_PARAMETER."
|
||||
*/
|
||||
ASSERT((ULONG_PTR)Source != (ULONG_PTR)Target);
|
||||
|
||||
/* Use the console input CP for the conversion */
|
||||
// *TargetLength = WideCharToMultiByte(Console->InputCodePage, 0,
|
||||
// Source, SourceLength,
|
||||
|
|
|
@ -16,10 +16,18 @@
|
|||
|
||||
/* GLOBALS ********************************************************************/
|
||||
|
||||
/*
|
||||
* From MSDN:
|
||||
* "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
|
||||
* If they are the same, the function fails, and GetLastError returns
|
||||
* ERROR_INVALID_PARAMETER."
|
||||
*/
|
||||
#define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
||||
ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
|
||||
WideCharToMultiByte((Console)->InputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
||||
|
||||
#define ConsoleInputAnsiCharToUnicodeChar(Console, dWChar, sChar) \
|
||||
ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
|
||||
MultiByteToWideChar((Console)->InputCodePage, 0, (sChar), 1, (dWChar), 1)
|
||||
|
||||
typedef struct ConsoleInput_t
|
||||
|
|
|
@ -352,10 +352,18 @@ do { \
|
|||
#define ConioRectWidth(Rect) \
|
||||
(((Rect)->Left) > ((Rect)->Right) ? 0 : ((Rect)->Right) - ((Rect)->Left) + 1)
|
||||
|
||||
/*
|
||||
* From MSDN:
|
||||
* "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
|
||||
* If they are the same, the function fails, and GetLastError returns
|
||||
* ERROR_INVALID_PARAMETER."
|
||||
*/
|
||||
#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
||||
ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
|
||||
WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
||||
|
||||
#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
|
||||
ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
|
||||
MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
|
||||
|
||||
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);
|
||||
|
|
|
@ -161,10 +161,18 @@ do { \
|
|||
#define ConioRectWidth(Rect) \
|
||||
(((Rect)->Left) > ((Rect)->Right) ? 0 : ((Rect)->Right) - ((Rect)->Left) + 1)
|
||||
|
||||
/*
|
||||
* From MSDN:
|
||||
* "The lpMultiByteStr and lpWideCharStr pointers must not be the same.
|
||||
* If they are the same, the function fails, and GetLastError returns
|
||||
* ERROR_INVALID_PARAMETER."
|
||||
*/
|
||||
#define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \
|
||||
ASSERT((ULONG_PTR)dChar != (ULONG_PTR)sWChar); \
|
||||
WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL)
|
||||
|
||||
#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \
|
||||
ASSERT((ULONG_PTR)dWChar != (ULONG_PTR)sChar); \
|
||||
MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1)
|
||||
|
||||
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y);
|
||||
|
|
Loading…
Reference in a new issue