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
f325bf74
Commit
f325bf74
authored
Jul 12, 2014
by
Thomas Faber
Committed by
Alexandre Julliard
Jul 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiag: Do not omit mandatory argument to WriteFile.
parent
d4c4f0ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
output.c
programs/dxdiag/output.c
+6
-3
No files found.
programs/dxdiag/output.c
View file @
f325bf74
...
...
@@ -72,6 +72,7 @@ static BOOL output_text_header(HANDLE hFile, const char *caption)
DWORD
len
=
strlen
(
caption
);
DWORD
total_len
=
3
*
(
len
+
sizeof
(
crlf
));
char
*
ptr
=
output_buffer
;
DWORD
bytes_written
;
assert
(
total_len
<=
sizeof
(
output_buffer
));
...
...
@@ -92,7 +93,7 @@ static BOOL output_text_header(HANDLE hFile, const char *caption)
memcpy
(
ptr
,
crlf
,
sizeof
(
crlf
));
return
WriteFile
(
hFile
,
output_buffer
,
total_len
,
NULL
,
NULL
);
return
WriteFile
(
hFile
,
output_buffer
,
total_len
,
&
bytes_written
,
NULL
);
}
static
BOOL
output_text_field
(
HANDLE
hFile
,
const
char
*
field_name
,
DWORD
field_width
,
const
WCHAR
*
value
)
...
...
@@ -102,6 +103,7 @@ static BOOL output_text_field(HANDLE hFile, const char *field_name, DWORD field_
DWORD
total_len
=
field_width
+
sizeof
(
": "
)
-
1
+
value_lenA
+
sizeof
(
crlf
);
char
sprintf_fmt
[
1
+
10
+
3
+
1
];
char
*
ptr
=
output_buffer
;
DWORD
bytes_written
;
assert
(
total_len
<=
sizeof
(
output_buffer
));
...
...
@@ -111,12 +113,13 @@ static BOOL output_text_field(HANDLE hFile, const char *field_name, DWORD field_
ptr
+=
WideCharToMultiByte
(
CP_ACP
,
0
,
value
,
value_lenW
,
ptr
,
value_lenA
,
NULL
,
NULL
);
memcpy
(
ptr
,
crlf
,
sizeof
(
crlf
));
return
WriteFile
(
hFile
,
output_buffer
,
total_len
,
NULL
,
NULL
);
return
WriteFile
(
hFile
,
output_buffer
,
total_len
,
&
bytes_written
,
NULL
);
}
static
BOOL
output_crlf
(
HANDLE
hFile
)
{
return
WriteFile
(
hFile
,
crlf
,
sizeof
(
crlf
),
NULL
,
NULL
);
DWORD
bytes_written
;
return
WriteFile
(
hFile
,
crlf
,
sizeof
(
crlf
),
&
bytes_written
,
NULL
);
}
static
inline
void
fill_system_text_output_table
(
struct
dxdiag_information
*
dxdiag_info
,
struct
text_information_field
*
fields
)
...
...
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