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
0b18409c
Commit
0b18409c
authored
Apr 01, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use C runtime wchar functions instead of wine/unicode.h.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
518a6c2d
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
41 deletions
+34
-41
childwnd.c
programs/regedit/childwnd.c
+1
-2
edit.c
programs/regedit/edit.c
+2
-3
framewnd.c
programs/regedit/framewnd.c
+2
-3
hexedit.c
programs/regedit/hexedit.c
+1
-2
listview.c
programs/regedit/listview.c
+0
-1
regedit.c
programs/regedit/regedit.c
+2
-3
regproc.c
programs/regedit/regproc.c
+26
-27
No files found.
programs/regedit/childwnd.c
View file @
0b18409c
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
...
@@ -243,7 +242,7 @@ static void get_last_key(HWND hwndTV)
...
@@ -243,7 +242,7 @@ static void get_last_key(HWND hwndTV)
HTREEITEM
selection
=
NULL
;
HTREEITEM
selection
=
NULL
;
if
(
RegQueryValueExW
(
hkey
,
wszLastKey
,
NULL
,
NULL
,
(
LPBYTE
)
wszVal
,
&
dwSize
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueExW
(
hkey
,
wszLastKey
,
NULL
,
NULL
,
(
LPBYTE
)
wszVal
,
&
dwSize
)
==
ERROR_SUCCESS
)
{
{
if
(
strcmpW
(
wszVal
,
g_pChildWnd
->
szPath
))
if
(
l
strcmpW
(
wszVal
,
g_pChildWnd
->
szPath
))
selection
=
FindPathInTree
(
hwndTV
,
wszVal
);
selection
=
FindPathInTree
(
hwndTV
,
wszVal
);
}
}
...
...
programs/regedit/edit.c
View file @
0b18409c
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include <shlwapi.h>
#include <shlwapi.h>
#include "wine/heap.h"
#include "wine/heap.h"
#include "wine/unicode.h"
#include "main.h"
#include "main.h"
static
const
WCHAR
*
editValueName
;
static
const
WCHAR
*
editValueName
;
...
@@ -531,7 +530,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
...
@@ -531,7 +530,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
if
(
!
keyPath
||
!
newName
)
return
FALSE
;
if
(
!
keyPath
||
!
newName
)
return
FALSE
;
if
(
!
strrchrW
(
keyPath
,
'\\'
))
{
if
(
!
wcsrchr
(
keyPath
,
'\\'
))
{
parentKey
=
hRootKey
;
parentKey
=
hRootKey
;
srcSubKey
=
keyPath
;
srcSubKey
=
keyPath
;
}
else
{
}
else
{
...
@@ -539,7 +538,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
...
@@ -539,7 +538,7 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCWSTR keyPath, LPCWSTR newName)
parentPath
=
heap_xalloc
((
lstrlenW
(
keyPath
)
+
1
)
*
sizeof
(
WCHAR
));
parentPath
=
heap_xalloc
((
lstrlenW
(
keyPath
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
parentPath
,
keyPath
);
lstrcpyW
(
parentPath
,
keyPath
);
srcSubKey_copy
=
strrchrW
(
parentPath
,
'\\'
);
srcSubKey_copy
=
wcsrchr
(
parentPath
,
'\\'
);
*
srcSubKey_copy
=
0
;
*
srcSubKey_copy
=
0
;
srcSubKey
=
srcSubKey_copy
+
1
;
srcSubKey
=
srcSubKey_copy
+
1
;
lRet
=
RegOpenKeyExW
(
hRootKey
,
parentPath
,
0
,
KEY_READ
|
KEY_CREATE_SUB_KEY
,
&
parentKey
);
lRet
=
RegOpenKeyExW
(
hRootKey
,
parentPath
,
0
,
KEY_READ
|
KEY_CREATE_SUB_KEY
,
&
parentKey
);
...
...
programs/regedit/framewnd.c
View file @
0b18409c
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
#include "main.h"
#include "main.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
WINE_DEFAULT_DEBUG_CHANNEL
(
regedit
);
...
@@ -280,7 +279,7 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
...
@@ -280,7 +279,7 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
/* load appropriate string*/
/* load appropriate string*/
LPWSTR
lpsz
=
str
;
LPWSTR
lpsz
=
str
;
/* first newline terminates actual string*/
/* first newline terminates actual string*/
lpsz
=
strchrW
(
lpsz
,
'\n'
);
lpsz
=
wcschr
(
lpsz
,
'\n'
);
if
(
lpsz
!=
NULL
)
if
(
lpsz
!=
NULL
)
*
lpsz
=
'\0'
;
*
lpsz
=
'\0'
;
}
}
...
@@ -427,7 +426,7 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAMEW *pofn)
...
@@ -427,7 +426,7 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAMEW *pofn)
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_REG
,
filter_reg
,
MAX_PATH
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_REG
,
filter_reg
,
MAX_PATH
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_REG4
,
filter_reg4
,
MAX_PATH
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_REG4
,
filter_reg4
,
MAX_PATH
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_ALL
,
filter_all
,
MAX_PATH
);
LoadStringW
(
hInst
,
IDS_FILEDIALOG_FILTER_ALL
,
filter_all
,
MAX_PATH
);
s
nprintfW
(
FilterBuffer
,
MAX_PATH
,
filterW
,
filter_reg
,
0
,
0
,
filter_reg4
,
0
,
0
,
filter_all
,
0
,
0
);
s
wprintf
(
FilterBuffer
,
filterW
,
filter_reg
,
0
,
0
,
filter_reg4
,
0
,
0
,
filter_all
,
0
,
0
);
}
}
pofn
->
lpstrFilter
=
FilterBuffer
;
pofn
->
lpstrFilter
=
FilterBuffer
;
pofn
->
nFilterIndex
=
1
;
pofn
->
nFilterIndex
=
1
;
...
...
programs/regedit/hexedit.c
View file @
0b18409c
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
#include "commctrl.h"
#include "commctrl.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "wine/unicode.h"
#include "main.h"
#include "main.h"
/* spaces dividing hex and ASCII */
/* spaces dividing hex and ASCII */
...
@@ -95,7 +94,7 @@ static LPWSTR HexEdit_GetLineText(int offset, BYTE *pData, LONG cbData, LONG pad
...
@@ -95,7 +94,7 @@ static LPWSTR HexEdit_GetLineText(int offset, BYTE *pData, LONG cbData, LONG pad
for
(
i
=
0
;
i
<
cbData
;
i
++
)
for
(
i
=
0
;
i
<
cbData
;
i
++
)
{
{
/* (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER) */
/* (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER) */
if
(
is
printW
(
pData
[
offset
+
i
]))
if
(
is
wprint
(
pData
[
offset
+
i
]))
lpszLine
[
6
+
cbData
*
3
+
pad
*
3
+
DIV_SPACES
+
i
]
=
pData
[
offset
+
i
];
lpszLine
[
6
+
cbData
*
3
+
pad
*
3
+
DIV_SPACES
+
i
]
=
pData
[
offset
+
i
];
else
else
lpszLine
[
6
+
cbData
*
3
+
pad
*
3
+
DIV_SPACES
+
i
]
=
'.'
;
lpszLine
[
6
+
cbData
*
3
+
pad
*
3
+
DIV_SPACES
+
i
]
=
'.'
;
...
...
programs/regedit/listview.c
View file @
0b18409c
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "main.h"
#include "main.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "wine/unicode.h"
static
INT
Image_String
;
static
INT
Image_String
;
static
INT
Image_Binary
;
static
INT
Image_Binary
;
...
...
programs/regedit/regedit.c
View file @
0b18409c
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
#include <windows.h>
#include <windows.h>
#include <commctrl.h>
#include <commctrl.h>
#include <shellapi.h>
#include <shellapi.h>
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/heap.h"
#include "main.h"
#include "main.h"
...
@@ -113,7 +112,7 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
...
@@ -113,7 +112,7 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
WCHAR
*
realname
=
NULL
;
WCHAR
*
realname
=
NULL
;
FILE
*
reg_file
;
FILE
*
reg_file
;
if
(
!
strcmpW
(
filename
,
hyphen
))
if
(
!
l
strcmpW
(
filename
,
hyphen
))
reg_file
=
stdin
;
reg_file
=
stdin
;
else
else
{
{
...
@@ -197,7 +196,7 @@ BOOL ProcessCmdLine(WCHAR *cmdline)
...
@@ -197,7 +196,7 @@ BOOL ProcessCmdLine(WCHAR *cmdline)
if
(
argv
[
i
][
1
]
&&
argv
[
i
][
2
]
&&
argv
[
i
][
2
]
!=
':'
)
if
(
argv
[
i
][
1
]
&&
argv
[
i
][
2
]
&&
argv
[
i
][
2
]
!=
':'
)
break
;
/* This is a file path beginning with '/'. */
break
;
/* This is a file path beginning with '/'. */
switch
(
to
upperW
(
argv
[
i
][
1
]))
switch
(
to
wupper
(
argv
[
i
][
1
]))
{
{
case
'?'
:
case
'?'
:
error_exit
(
STRING_USAGE
);
error_exit
(
STRING_USAGE
);
...
...
programs/regedit/regproc.c
View file @
0b18409c
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
#include <io.h>
#include <io.h>
#include <windows.h>
#include <windows.h>
#include <commctrl.h>
#include <commctrl.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include <wine/debug.h>
#include <wine/heap.h>
#include <wine/heap.h>
#include "main.h"
#include "main.h"
...
@@ -243,7 +242,7 @@ static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw)
...
@@ -243,7 +242,7 @@ static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw)
if
(
!*
str
)
goto
error
;
if
(
!*
str
)
goto
error
;
p
=
str
;
p
=
str
;
while
(
is
xdigitW
(
*
p
))
while
(
is
wxdigit
(
*
p
))
{
{
count
++
;
count
++
;
p
++
;
p
++
;
...
@@ -255,7 +254,7 @@ static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw)
...
@@ -255,7 +254,7 @@ static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw)
if
(
*
p
&&
*
p
!=
';'
)
goto
error
;
if
(
*
p
&&
*
p
!=
';'
)
goto
error
;
*
end
=
0
;
*
end
=
0
;
*
dw
=
strtoulW
(
str
,
&
end
,
16
);
*
dw
=
wcstoul
(
str
,
&
end
,
16
);
return
TRUE
;
return
TRUE
;
error:
error:
...
@@ -288,7 +287,7 @@ static BOOL convert_hex_csv_to_hex(struct parser *parser, WCHAR **str)
...
@@ -288,7 +287,7 @@ static BOOL convert_hex_csv_to_hex(struct parser *parser, WCHAR **str)
WCHAR
*
end
;
WCHAR
*
end
;
unsigned
long
wc
;
unsigned
long
wc
;
wc
=
strtoulW
(
s
,
&
end
,
16
);
wc
=
wcstoul
(
s
,
&
end
,
16
);
if
(
wc
>
0xff
)
return
FALSE
;
if
(
wc
>
0xff
)
return
FALSE
;
if
(
s
==
end
&&
wc
==
0
)
if
(
s
==
end
&&
wc
==
0
)
...
@@ -350,7 +349,7 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
...
@@ -350,7 +349,7 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
for
(
ptr
=
data_types
;
ptr
->
tag
;
ptr
++
)
for
(
ptr
=
data_types
;
ptr
->
tag
;
ptr
++
)
{
{
if
(
strncmpW
(
ptr
->
tag
,
*
line
,
ptr
->
len
))
if
(
wcsncmp
(
ptr
->
tag
,
*
line
,
ptr
->
len
))
continue
;
continue
;
parser
->
parse_type
=
ptr
->
parse_type
;
parser
->
parse_type
=
ptr
->
parse_type
;
...
@@ -362,7 +361,7 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
...
@@ -362,7 +361,7 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
WCHAR
*
end
;
WCHAR
*
end
;
DWORD
val
;
DWORD
val
;
if
(
!**
line
||
to
lowerW
((
*
line
)[
1
])
==
'x'
)
if
(
!**
line
||
to
wlower
((
*
line
)[
1
])
==
'x'
)
return
FALSE
;
return
FALSE
;
/* "hex(xx):" is special */
/* "hex(xx):" is special */
...
@@ -434,13 +433,13 @@ static HKEY parse_key_name(WCHAR *key_name, WCHAR **key_path)
...
@@ -434,13 +433,13 @@ static HKEY parse_key_name(WCHAR *key_name, WCHAR **key_path)
if
(
!
key_name
)
return
0
;
if
(
!
key_name
)
return
0
;
*
key_path
=
strchrW
(
key_name
,
'\\'
);
*
key_path
=
wcschr
(
key_name
,
'\\'
);
if
(
*
key_path
)
(
*
key_path
)
++
;
if
(
*
key_path
)
(
*
key_path
)
++
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
reg_class_keys
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
reg_class_keys
);
i
++
)
{
{
int
len
=
lstrlenW
(
reg_class_namesW
[
i
]);
int
len
=
lstrlenW
(
reg_class_namesW
[
i
]);
if
(
!
strncmpiW
(
key_name
,
reg_class_namesW
[
i
],
len
)
&&
if
(
!
wcsnicmp
(
key_name
,
reg_class_namesW
[
i
],
len
)
&&
(
key_name
[
len
]
==
0
||
key_name
[
len
]
==
'\\'
))
(
key_name
[
len
]
==
0
||
key_name
[
len
]
==
'\\'
))
{
{
return
reg_class_keys
[
i
];
return
reg_class_keys
[
i
];
...
@@ -552,13 +551,13 @@ static enum reg_versions parse_file_header(const WCHAR *s)
...
@@ -552,13 +551,13 @@ static enum reg_versions parse_file_header(const WCHAR *s)
while
(
*
s
==
' '
||
*
s
==
'\t'
)
s
++
;
while
(
*
s
==
' '
||
*
s
==
'\t'
)
s
++
;
if
(
!
strcmpW
(
s
,
header_31
))
if
(
!
l
strcmpW
(
s
,
header_31
))
return
REG_VERSION_31
;
return
REG_VERSION_31
;
if
(
!
strcmpW
(
s
,
header_40
))
if
(
!
l
strcmpW
(
s
,
header_40
))
return
REG_VERSION_40
;
return
REG_VERSION_40
;
if
(
!
strcmpW
(
s
,
header_50
))
if
(
!
l
strcmpW
(
s
,
header_50
))
return
REG_VERSION_50
;
return
REG_VERSION_50
;
/* The Windows version accepts registry file headers beginning with "REGEDIT" and ending
/* The Windows version accepts registry file headers beginning with "REGEDIT" and ending
...
@@ -566,7 +565,7 @@ static enum reg_versions parse_file_header(const WCHAR *s)
...
@@ -566,7 +565,7 @@ static enum reg_versions parse_file_header(const WCHAR *s)
* "REGEDIT 4", "REGEDIT9" and "REGEDIT4FOO" are all treated as valid file headers.
* "REGEDIT 4", "REGEDIT9" and "REGEDIT4FOO" are all treated as valid file headers.
* In all such cases, however, the contents of the registry file are not imported.
* In all such cases, however, the contents of the registry file are not imported.
*/
*/
if
(
!
strncmpW
(
s
,
header_31
,
7
))
/* "REGEDIT" without NUL */
if
(
!
wcsncmp
(
s
,
header_31
,
7
))
/* "REGEDIT" without NUL */
return
REG_VERSION_FUZZY
;
return
REG_VERSION_FUZZY
;
return
REG_VERSION_INVALID
;
return
REG_VERSION_INVALID
;
...
@@ -618,11 +617,11 @@ static WCHAR *parse_win31_line_state(struct parser *parser, WCHAR *pos)
...
@@ -618,11 +617,11 @@ static WCHAR *parse_win31_line_state(struct parser *parser, WCHAR *pos)
if
(
!
(
line
=
get_line
(
parser
->
file
)))
if
(
!
(
line
=
get_line
(
parser
->
file
)))
return
NULL
;
return
NULL
;
if
(
strncmpW
(
line
,
hkcr
,
ARRAY_SIZE
(
hkcr
)))
if
(
wcsncmp
(
line
,
hkcr
,
ARRAY_SIZE
(
hkcr
)))
return
line
;
return
line
;
/* get key name */
/* get key name */
while
(
line
[
key_end
]
&&
!
is
spaceW
(
line
[
key_end
]))
key_end
++
;
while
(
line
[
key_end
]
&&
!
is
wspace
(
line
[
key_end
]))
key_end
++
;
value
=
line
+
key_end
;
value
=
line
+
key_end
;
while
(
*
value
==
' '
||
*
value
==
'\t'
)
value
++
;
while
(
*
value
==
' '
||
*
value
==
'\t'
)
value
++
;
...
@@ -684,7 +683,7 @@ static WCHAR *key_name_state(struct parser *parser, WCHAR *pos)
...
@@ -684,7 +683,7 @@ static WCHAR *key_name_state(struct parser *parser, WCHAR *pos)
{
{
WCHAR
*
p
=
pos
,
*
key_end
;
WCHAR
*
p
=
pos
,
*
key_end
;
if
(
*
p
==
' '
||
*
p
==
'\t'
||
!
(
key_end
=
strrchrW
(
p
,
']'
)))
if
(
*
p
==
' '
||
*
p
==
'\t'
||
!
(
key_end
=
wcsrchr
(
p
,
']'
)))
goto
done
;
goto
done
;
*
key_end
=
0
;
*
key_end
=
0
;
...
@@ -761,7 +760,7 @@ static WCHAR *data_start_state(struct parser *parser, WCHAR *pos)
...
@@ -761,7 +760,7 @@ static WCHAR *data_start_state(struct parser *parser, WCHAR *pos)
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
/* trim trailing whitespace */
/* trim trailing whitespace */
len
=
strlenW
(
p
);
len
=
l
strlenW
(
p
);
while
(
len
>
0
&&
(
p
[
len
-
1
]
==
' '
||
p
[
len
-
1
]
==
'\t'
))
len
--
;
while
(
len
>
0
&&
(
p
[
len
-
1
]
==
' '
||
p
[
len
-
1
]
==
'\t'
))
len
--
;
p
[
len
]
=
0
;
p
[
len
]
=
0
;
...
@@ -926,7 +925,7 @@ static WCHAR *hex_multiline_state(struct parser *parser, WCHAR *pos)
...
@@ -926,7 +925,7 @@ static WCHAR *hex_multiline_state(struct parser *parser, WCHAR *pos)
while
(
*
line
==
' '
||
*
line
==
'\t'
)
line
++
;
while
(
*
line
==
' '
||
*
line
==
'\t'
)
line
++
;
if
(
!*
line
||
*
line
==
';'
)
return
line
;
if
(
!*
line
||
*
line
==
';'
)
return
line
;
if
(
!
is
xdigitW
(
*
line
))
goto
invalid
;
if
(
!
is
wxdigit
(
*
line
))
goto
invalid
;
set_state
(
parser
,
HEX_DATA
);
set_state
(
parser
,
HEX_DATA
);
return
line
;
return
line
;
...
@@ -1040,11 +1039,11 @@ static WCHAR *get_lineW(FILE *fp)
...
@@ -1040,11 +1039,11 @@ static WCHAR *get_lineW(FILE *fp)
while
(
next
)
while
(
next
)
{
{
static
const
WCHAR
line_endings
[]
=
{
'\r'
,
'\n'
,
0
};
static
const
WCHAR
line_endings
[]
=
{
'\r'
,
'\n'
,
0
};
WCHAR
*
p
=
strpbrkW
(
line
,
line_endings
);
WCHAR
*
p
=
wcspbrk
(
line
,
line_endings
);
if
(
!
p
)
if
(
!
p
)
{
{
size_t
len
,
count
;
size_t
len
,
count
;
len
=
strlenW
(
next
);
len
=
l
strlenW
(
next
);
memmove
(
buf
,
next
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
memmove
(
buf
,
next
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
size
-
len
<
3
)
if
(
size
-
len
<
3
)
{
{
...
@@ -1217,7 +1216,7 @@ static size_t export_value_name(FILE *fp, WCHAR *name, size_t len, BOOL unicode)
...
@@ -1217,7 +1216,7 @@ static size_t export_value_name(FILE *fp, WCHAR *name, size_t len, BOOL unicode)
{
{
WCHAR
*
str
=
REGPROC_escape_string
(
name
,
len
,
&
line_len
);
WCHAR
*
str
=
REGPROC_escape_string
(
name
,
len
,
&
line_len
);
WCHAR
*
buf
=
heap_xalloc
((
line_len
+
4
)
*
sizeof
(
WCHAR
));
WCHAR
*
buf
=
heap_xalloc
((
line_len
+
4
)
*
sizeof
(
WCHAR
));
line_len
=
s
printfW
(
buf
,
quoted_fmt
,
str
);
line_len
=
s
wprintf
(
buf
,
quoted_fmt
,
str
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
heap_free
(
buf
);
heap_free
(
buf
);
heap_free
(
str
);
heap_free
(
str
);
...
@@ -1241,7 +1240,7 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
...
@@ -1241,7 +1240,7 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size)
len
=
size
/
sizeof
(
WCHAR
)
-
1
;
len
=
size
/
sizeof
(
WCHAR
)
-
1
;
str
=
REGPROC_escape_string
(
data
,
len
,
&
line_len
);
str
=
REGPROC_escape_string
(
data
,
len
,
&
line_len
);
*
buf
=
heap_xalloc
((
line_len
+
3
)
*
sizeof
(
WCHAR
));
*
buf
=
heap_xalloc
((
line_len
+
3
)
*
sizeof
(
WCHAR
));
s
printfW
(
*
buf
,
fmt
,
str
);
s
wprintf
(
*
buf
,
fmt
,
str
);
heap_free
(
str
);
heap_free
(
str
);
}
}
...
@@ -1250,7 +1249,7 @@ static void export_dword_data(WCHAR **buf, DWORD *data)
...
@@ -1250,7 +1249,7 @@ static void export_dword_data(WCHAR **buf, DWORD *data)
static
const
WCHAR
fmt
[]
=
{
'd'
,
'w'
,
'o'
,
'r'
,
'd'
,
':'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'd'
,
'w'
,
'o'
,
'r'
,
'd'
,
':'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
*
buf
=
heap_xalloc
(
15
*
sizeof
(
WCHAR
));
*
buf
=
heap_xalloc
(
15
*
sizeof
(
WCHAR
));
s
printfW
(
*
buf
,
fmt
,
*
data
);
s
wprintf
(
*
buf
,
fmt
,
*
data
);
}
}
static
size_t
export_hex_data_type
(
FILE
*
fp
,
DWORD
type
,
BOOL
unicode
)
static
size_t
export_hex_data_type
(
FILE
*
fp
,
DWORD
type
,
BOOL
unicode
)
...
@@ -1267,7 +1266,7 @@ static size_t export_hex_data_type(FILE *fp, DWORD type, BOOL unicode)
...
@@ -1267,7 +1266,7 @@ static size_t export_hex_data_type(FILE *fp, DWORD type, BOOL unicode)
else
else
{
{
WCHAR
*
buf
=
heap_xalloc
(
15
*
sizeof
(
WCHAR
));
WCHAR
*
buf
=
heap_xalloc
(
15
*
sizeof
(
WCHAR
));
line_len
=
s
printfW
(
buf
,
hexp_fmt
,
type
);
line_len
=
s
wprintf
(
buf
,
hexp_fmt
,
type
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
heap_free
(
buf
);
heap_free
(
buf
);
}
}
...
@@ -1296,7 +1295,7 @@ static void export_hex_data(FILE *fp, WCHAR **buf, DWORD type, DWORD line_len,
...
@@ -1296,7 +1295,7 @@ static void export_hex_data(FILE *fp, WCHAR **buf, DWORD type, DWORD line_len,
for
(
i
=
0
,
pos
=
0
;
i
<
size
;
i
++
)
for
(
i
=
0
,
pos
=
0
;
i
<
size
;
i
++
)
{
{
pos
+=
s
printfW
(
*
buf
+
pos
,
fmt
,
((
BYTE
*
)
data
)[
i
]);
pos
+=
s
wprintf
(
*
buf
+
pos
,
fmt
,
((
BYTE
*
)
data
)[
i
]);
if
(
i
==
num_commas
)
break
;
if
(
i
==
num_commas
)
break
;
(
*
buf
)[
pos
++
]
=
','
;
(
*
buf
)[
pos
++
]
=
','
;
(
*
buf
)[
pos
]
=
0
;
(
*
buf
)[
pos
]
=
0
;
...
@@ -1361,7 +1360,7 @@ static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name,
...
@@ -1361,7 +1360,7 @@ static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name,
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
subkey_path
=
heap_xalloc
((
path_len
+
subkey_len
+
2
)
*
sizeof
(
WCHAR
));
subkey_path
=
heap_xalloc
((
path_len
+
subkey_len
+
2
)
*
sizeof
(
WCHAR
));
s
printfW
(
subkey_path
,
fmt
,
path
,
subkey_name
);
s
wprintf
(
subkey_path
,
fmt
,
path
,
subkey_name
);
return
subkey_path
;
return
subkey_path
;
}
}
...
@@ -1372,7 +1371,7 @@ static void export_key_name(FILE *fp, WCHAR *name, BOOL unicode)
...
@@ -1372,7 +1371,7 @@ static void export_key_name(FILE *fp, WCHAR *name, BOOL unicode)
WCHAR
*
buf
;
WCHAR
*
buf
;
buf
=
heap_xalloc
((
lstrlenW
(
name
)
+
7
)
*
sizeof
(
WCHAR
));
buf
=
heap_xalloc
((
lstrlenW
(
name
)
+
7
)
*
sizeof
(
WCHAR
));
s
printfW
(
buf
,
fmt
,
name
);
s
wprintf
(
buf
,
fmt
,
name
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
REGPROC_write_line
(
fp
,
buf
,
unicode
);
heap_free
(
buf
);
heap_free
(
buf
);
}
}
...
@@ -1457,7 +1456,7 @@ static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode)
...
@@ -1457,7 +1456,7 @@ static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode)
FILE
*
file
;
FILE
*
file
;
static
const
WCHAR
hyphen
[]
=
{
'-'
,
0
};
static
const
WCHAR
hyphen
[]
=
{
'-'
,
0
};
if
(
!
strcmpW
(
file_name
,
hyphen
))
if
(
!
l
strcmpW
(
file_name
,
hyphen
))
{
{
file
=
stdout
;
file
=
stdout
;
_setmode
(
_fileno
(
file
),
_O_BINARY
);
_setmode
(
_fileno
(
file
),
_O_BINARY
);
...
...
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