Commit 722fd584 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

kernel32: Process CRLF escape sequences in normal insert sequence processing…

kernel32: Process CRLF escape sequences in normal insert sequence processing path in FormatMessageA/W.
parent 1d18b890
......@@ -360,6 +360,14 @@ static LPWSTR format_message( BOOL unicode_caller, DWORD dwFlags, LPCWSTR fmtstr
ADD_TO_T('\n');
f++;
break;
case 'r':
ADD_TO_T('\r');
f++;
break;
case 't':
ADD_TO_T('\t');
f++;
break;
case '0':
eos = TRUE;
f++;
......
......@@ -84,6 +84,7 @@ static void test_message_from_string_wide(void)
static const WCHAR fmt_t0t[] = {'t','e','s','t','%','0','t','e','s','t',0};
static const WCHAR fmt_yah[] = {'y','a','h','%','!','%','0',' ',' ',' ',0};
static const WCHAR fmt_space[] = {'%',' ','%',' ',' ',' ',0};
static const WCHAR fmt_nrt[] = {'%','n','%','r','%','t',0};
static const WCHAR fmt_hi_lf[] = {'h','i','\n',0};
static const WCHAR fmt_hi_crlf[] = {'h','i','\r','\n',0};
static const WCHAR fmt_cr[] = {'\r',0};
......@@ -108,6 +109,7 @@ static void test_message_from_string_wide(void)
static const WCHAR s_2dot147[] = {' ','.','.',' ',' ','4','2','7',0};
static const WCHAR s_yah[] = {'y','a','h','!',0};
static const WCHAR s_space[] = {' ',' ',' ',' ',0};
static const WCHAR s_nrt[] = {'\r','\n','\r','\t',0};
static const WCHAR s_hi_crlf[] = {'h','i','\r','\n',0};
static const WCHAR s_crlf[] = {'\r','\n',0};
static const WCHAR s_crlfcrlf[] = {'\r','\n','\r','\n',0};
......@@ -327,6 +329,12 @@ static void test_message_from_string_wide(void)
ok(!lstrcmpW(s_space, out), "failed out=%s\n", wine_dbgstr_w(out));
ok(r==4,"failed: r=%d\n", r);
/* %n yields \r\n, %r yields \r, %t yields \t */
r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_nrt, 0,
0, out, sizeof(out)/sizeof(WCHAR));
ok(!lstrcmpW(s_nrt, out), "failed out=%s\n", wine_dbgstr_w(out));
ok(r==4,"failed: r=%d\n", r);
/* line feed */
r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_hi_lf, 0,
0, out, sizeof(out)/sizeof(WCHAR));
......@@ -624,6 +632,12 @@ static void test_message_from_string(void)
ok(!strcmp(" ", out),"failed out=[%s]\n",out);
ok(r==4,"failed: r=%d\n",r);
/* %n yields \r\n, %r yields \r, %t yields \t */
r = doit(FORMAT_MESSAGE_FROM_STRING, "%n%r%t", 0,
0, out, sizeof(out)/sizeof(CHAR));
ok(!strcmp("\r\n\r\t", out),"failed out=[%s]\n",out);
ok(r==4,"failed: r=%d\n",r);
/* line feed */
r = doit(FORMAT_MESSAGE_FROM_STRING, "hi\n", 0,
0, out, sizeof(out)/sizeof(CHAR));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment