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
ae8a4019
Commit
ae8a4019
authored
Nov 06, 2001
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Nov 06, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The 'dword' values should be stored as big endian values.
parent
2e40b964
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
35 deletions
+13
-35
regapi.c
programs/regapi/regapi.c
+13
-35
No files found.
programs/regapi/regapi.c
View file @
ae8a4019
...
...
@@ -361,26 +361,14 @@ static INT getCommand(LPSTR commandName)
*/
static
DWORD
convertHexToDWord
(
char
*
str
,
BYTE
*
buf
)
{
char
*
s
=
str
;
/* Pointer to current */
char
*
b
=
buf
;
/* Pointer to result */
ULONG
strPos
=
0
;
memset
(
buf
,
0
,
4
);
while
(
strPos
<
4
)
/* 8 byte in a DWORD */
{
char
xbuf
[
3
];
char
wc
;
memcpy
(
xbuf
,
s
,
2
);
xbuf
[
2
]
=
'\0'
;
sscanf
(
xbuf
,
"%02x"
,(
UINT
*
)
&
wc
);
*
b
++
=
(
unsigned
char
)
wc
;
s
+=
2
;
strPos
+=
1
;
}
return
4
;
/* always 4 byte for the word */
DWORD
dw
;
char
xbuf
[
9
];
memcpy
(
xbuf
,
str
,
8
);
xbuf
[
8
]
=
'\0'
;
sscanf
(
xbuf
,
"%08lx"
,
&
dw
);
memcpy
(
buf
,
&
dw
,
sizeof
(
DWORD
));
return
sizeof
(
DWORD
);
}
/******************************************************************************
...
...
@@ -420,24 +408,14 @@ static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen)
static
char
*
convertHexToDWORDStr
(
BYTE
*
buf
,
ULONG
bufLen
)
{
char
*
str
;
char
*
ptrStr
;
BYTE
*
ptrBuf
;
ULONG
current
=
0
;
DWORD
dw
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
bufLen
*
2
)
+
1
);
memset
(
str
,
0
,
(
bufLen
*
2
)
+
1
);
ptrStr
=
str
;
/* Pointer to result */
ptrBuf
=
buf
;
/* Pointer to current */
if
(
bufLen
!=
sizeof
(
DWORD
)
)
return
NULL
;
while
(
current
<
bufLen
)
{
BYTE
bCur
=
ptrBuf
[
current
++
];
char
res
[
3
];
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
bufLen
*
2
)
+
1
);
sprintf
(
res
,
"%02x"
,
(
unsigned
int
)
*&
bCur
);
strcat
(
str
,
res
);
}
memcpy
(
&
dw
,
buf
,
sizeof
(
DWORD
));
sprintf
(
str
,
"%08lx"
,
dw
);
/* Get rid of the last comma */
return
str
;
...
...
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