Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dfe1c2b5
Commit
dfe1c2b5
authored
Feb 09, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Feb 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Use FormatMessage for easier internationalization support.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bfcee1f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
reg.c
programs/reg/reg.c
+18
-7
No files found.
programs/reg/reg.c
View file @
dfe1c2b5
...
...
@@ -18,10 +18,13 @@
#include <windows.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include "reg.h"
#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A))
WINE_DEFAULT_DEBUG_CHANNEL
(
reg
);
static
const
WCHAR
short_hklm
[]
=
{
'H'
,
'K'
,
'L'
,
'M'
,
0
};
static
const
WCHAR
short_hkcu
[]
=
{
'H'
,
'K'
,
'C'
,
'U'
,
0
};
static
const
WCHAR
short_hkcr
[]
=
{
'H'
,
'K'
,
'C'
,
'R'
,
0
};
...
...
@@ -74,7 +77,7 @@ type_rels[] =
{
REG_MULTI_SZ
,
type_multi_sz
},
};
static
void
output_writeconsole
(
const
WCHAR
*
str
,
int
wlen
)
static
void
output_writeconsole
(
const
WCHAR
*
str
,
DWORD
wlen
)
{
DWORD
count
,
ret
;
...
...
@@ -100,11 +103,19 @@ static void output_writeconsole(const WCHAR *str, int wlen)
static
void
output_formatstring
(
const
WCHAR
*
fmt
,
__ms_va_list
va_args
)
{
WCHAR
msg_buffer
[
8192
]
;
int
len
;
WCHAR
*
str
;
DWORD
len
;
len
=
vsnprintfW
(
msg_buffer
,
sizeof
(
msg_buffer
)
/
sizeof
(
WCHAR
),
fmt
,
va_args
);
output_writeconsole
(
msg_buffer
,
len
);
SetLastError
(
NO_ERROR
);
len
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_ALLOCATE_BUFFER
,
fmt
,
0
,
0
,
(
WCHAR
*
)
&
str
,
0
,
&
va_args
);
if
(
len
==
0
&&
GetLastError
()
!=
NO_ERROR
)
{
WINE_FIXME
(
"Could not format string: le=%u, fmt=%s
\n
"
,
GetLastError
(),
wine_dbgstr_w
(
fmt
));
return
;
}
output_writeconsole
(
str
,
len
);
LocalFree
(
str
);
}
static
void
reg_message
(
int
msg
)
...
...
@@ -237,7 +248,7 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
}
default:
{
static
const
WCHAR
unhandled
[]
=
{
'U'
,
'n'
,
'h'
,
'a'
,
'n'
,
'd'
,
'l'
,
'e'
,
'd'
,
' '
,
'T'
,
'y'
,
'p'
,
'e'
,
' '
,
'0'
,
'x'
,
'%'
,
'
x'
,
' '
,
' '
,
'd'
,
'a'
,
't'
,
'a'
,
' '
,
'%'
,
's
'
,
'\n'
,
0
};
static
const
WCHAR
unhandled
[]
=
{
'U'
,
'n'
,
'h'
,
'a'
,
'n'
,
'd'
,
'l'
,
'e'
,
'd'
,
' '
,
'T'
,
'y'
,
'p'
,
'e'
,
' '
,
'0'
,
'x'
,
'%'
,
'
1'
,
'!'
,
'x'
,
'!'
,
' '
,
' '
,
'd'
,
'a'
,
't'
,
'a'
,
' '
,
'%'
,
'2
'
,
'\n'
,
0
};
output_string
(
unhandled
,
reg_type
,
data
);
}
}
...
...
@@ -446,7 +457,7 @@ static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
BOOL
subkey
)
{
static
const
WCHAR
stubW
[]
=
{
'S'
,
'T'
,
'U'
,
'B'
,
' '
,
'Q'
,
'U'
,
'E'
,
'R'
,
'Y'
,
' '
,
'-'
,
' '
,
'%'
,
'
s'
,
' '
,
'%'
,
's'
,
' '
,
'%'
,
'd'
,
' '
,
'%'
,
'd
'
,
'\n'
,
0
};
'-'
,
' '
,
'%'
,
'
1'
,
' '
,
'%'
,
'2'
,
' '
,
'%'
,
'3'
,
'!'
,
'd'
,
'!'
,
' '
,
'%'
,
'4'
,
'!'
,
'd'
,
'!
'
,
'\n'
,
0
};
output_string
(
stubW
,
key_name
,
value_name
,
value_empty
,
subkey
);
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment